From: dima at dimych dot sumy dot ua
Operating system: FreeBSD 4.9-STABLE #0
PHP version: 4.4.1RC1
PHP Bug Type: Sockets related
Bug description: socket_read() produces warninigs on non blocking sockets
Description:
------------
Use of socket_read() on non blocking sockets produces warinigs like:
socket_read() unable to read from socket [35]: Resource temporarily
unavailable
I`m storing all php errors in log file /var/log/php.log.
This warning causes overflow of /var partition because socket_read()
called to wait icmp message.
Reproduce code:
---------------
$socket = socket_create(AF_INET, SOCK_RAW, 1);
socket_connect($socket, $host, null);
$startTime = microtime_float(true);
socket_send($socket, $data, strLen($data), 0);
socket_set_nonblock($socket);
while((microtime_float() - $startTime) < 0.5) {
$mt = microtime_float();
if (socket_read($socket, 255)) {
break;
}
}
socket_close($socket);
Expected result:
----------------
no warnings in php.log
Actual result:
--------------
I`m receive huge count of warinigs in my php.log file like this:
socket_read() unable to read from socket [35]: Resource temporarily
unavailable
--
Edit bug report at http://bugs.php.net/?id=35062&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35062&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35062&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35062&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35062&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35062&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35062&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35062&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35062&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35062&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35062&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35062&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35062&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35062&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35062&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35062&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35062&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35062&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35062&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35062&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35062&r=mysqlcfg