From: nick dot telford at gmail dot com
Operating system: CentOS 5.3
PHP version: 5.2.9
PHP Bug Type: Streams related
Bug description: $errstr in stream_socket_client() periodically not set when
error occurs
Description:
------------
I've noticed that some errors in stream_socket_client()s connection don't
populate errstr with an error. As far as I can tell, errno is always
populated.
The most consistent case I've found for this if when the error code is 16
- $errstr SHOULD be "Device or resource busy" (according to some googling),
however, it is empty.
I've also come across many errono's that are > 127 and have no errstr.
e.g. 5736689
Reproduce code:
---------------
Unless someone knows how to reproduce "Device or resource busy", then I
can't create any code to reproduce errno 16 having no errstr.
I can reproduce the oddly high errno's (with no errstr) as the example
above appears to be for invalid URLs:
<?php
$stream = stream_socket_client('tcp://tinyu:80', $errno, $errstr);
echo "$errno\n";
echo "'$errstr'\n";
Expected result:
----------------
Not sure what the error number *should* be, possibly 22 (EINVAL), Invalid
argument. I'll go with that:
22
'Invalid argument'
Actual result:
--------------
5736689
''
--
Edit bug report at http://bugs.php.net/?id=48473&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48473&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48473&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48473&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48473&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48473&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48473&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48473&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48473&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48473&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48473&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48473&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48473&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48473&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48473&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48473&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48473&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48473&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48473&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48473&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48473&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48473&r=mysqlcfg