mikepultz / netdns2

Native PHP DNS Resolver and Updater
https://netdns2.com/
Other
119 stars 64 forks source link

shmop_*() expects parameter 1 to be resource, boolean given #117

Closed ghost closed 2 years ago

ghost commented 3 years ago

Apache 2.4.33 PHP 7.2.5 (FPM) About pear.php.net/Net_DNS2-1.5.0

mbstring.func_overload = 0
try
{
    $r = new Net_DNS2_Resolver(array(
        'nameservers'   => $this->DNSInternal,
        'use_tcp'       => true,
        'cache_file'    => $this->DNSInternalCache,
        'cache_type'    => 'shared',
        'cache_size'    => 100000
    ));
}
catch (Net_DNS2_Exception $e)
{
}

AH01071: Got error 'PHP message: PHP Warning: shmop_size() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 192\nPHP message: PHP Warning: shmop_read() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 197\nPHP message: PHP Warning: shmop_delete() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 228\nPHP message: PHP Warning: shmop_size() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 192\nPHP message: PHP Warning: shmop_read() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 197\nPHP message: PHP Warning: shmop_delete() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 228\nPHP message: PHP Warning: shmop_size() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 192\nPHP message: PHP Warning: shmop_read() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 197\nPHP message: PHP Warning: shmop_delete() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 228\nPHP message: PHP Warning: shmop_size() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 192\nPHP message: PHP Warning: shmop_read() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 197\nPHP message: PHP Warning: shmop_delete() expects parameter 1 to be resource, boolean given in /usr/share/php7/PEAR/Net/DNS2/Cache/Shm.php on line 228\n'

Rights okay as file is created. Associated HEX (0x7431548b) for int(1949389963) shows with ipcs -m if I do a manual ftok($this->DNSInternalCache, 't'); but the @shmop_open($this->_cache_file_tok, 'w', 0, 0); always comes back (bool)false

mikepultz commented 3 years ago

hey @Rehtael

So obviously the call to shmop_open() failing is causing all the errors; I should definitely have another check after to verify that the handle is good before I use it.

But I haven't been able to reproduce the issue on my system- can you remove the @ on the front of the shmop_open() calls, to see if it generates an error that might point to something else?

Mike

mikepultz commented 2 years ago

Unable to reproduce; if it happens again, then we re-evaluate.