From: fhoenig at kargo dot com Operating system: FreeBSD 7.0 / AMD64 PHP version: 5.2.5 PHP Bug Type: Reproducible crash Bug description: STREAM_CLIENT_ASYNC_CONNECT does does not work
Description: ------------ The below code only works with sleeping in between stream_socket_client() and the first IO on the socket. No error though. Works on FreeBSD 6.2 and linux as well as OSX. Just not on Freebsd 7.0. was installed through ports with default options. What changed in freebsd 7 that could cause that? Fix through sysctl option maybe? Reproduce code: --------------- $fp = stream_socket_client("tcp://www.google.com:80", $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT); //sleep(1); <=== works only with sleep uncommented. if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { fwrite($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\nAccept: */*\r\n\r\n"); while (!feof($fp)) { echo fgets($fp, 1024); } fclose($fp); } Expected result: ---------------- The html output from www.google.com/ Actual result: -------------- Locks up after fwrite and never reads anything from the socket. No error. -- Edit bug report at http://bugs.php.net/?id=44864&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44864&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44864&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44864&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44864&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44864&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44864&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44864&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44864&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44864&r=support Expected behavior: http://bugs.php.net/fix.php?id=44864&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44864&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44864&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44864&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44864&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44864&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44864&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44864&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44864&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44864&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44864&r=mysqlcfg