From: [EMAIL PROTECTED] Operating system: Windows XP PHP version: 4.3.0RC2 PHP Bug Type: Sockets related Bug description: socket_read on Multihomed Windows XP crashes PHP
I have written a couple OO-PHP based TCP clients for a Proprietary PHP Socket Server that create a web based interface to certin aspects of an unnamed server. This week, we had some hardware trouble, and we ended up moving one server to Windows XP instead of Windows 2000. It was a clean format.(new hd) After some intial re-installation, I have found, that anytime I call the socket_read function PHP promptly crashes. The exact same code worked on the same hardware running windows 2000, and the code also works completely on Slackware-9.0(current). The only thing that is unquie about this server is that it is Multihomed to about 30 different IP addresses. This is repeatable. 100% everytime, using Apache2 Module, Apache13 Module, and the CLI interfaces to PHP. The example script for a TCP Client on the Sockets Documentation also crashes PHP: <?php error_reporting (E_ALL); echo "<h2>TCP/IP Connection</h2>\n"; /* Get the port for the WWW service. */ $service_port = getservbyname ('www', 'tcp'); /* Get the IP address for the target host. */ $address = gethostbyname ('www.example.com'); /* Create a TCP/IP socket. */ $socket = socket_create (AF_INET, SOCK_STREAM, 0); if ($socket < 0) { echo "socket_create() failed: reason: " . socket_strerror ($socket) . "\n"; } else { echo "OK.\n"; } echo "Attempting to connect to '$address' on port '$service_port'..."; $result = socket_connect ($socket, $address, $service_port); if ($result < 0) { echo "socket_connect() failed.\nReason: ($result) " . socket_strerror($result) . "\n"; } else { echo "OK.\n"; } $in = "HEAD / HTTP/1.0\r\n\r\n"; $out = ''; echo "Sending HTTP HEAD request..."; socket_write ($socket, $in, strlen ($in)); echo "OK.\n"; echo "Reading response:\n\n"; while ($out = socket_read ($socket, 2048)) { echo $out; } echo "Closing socket..."; socket_close ($socket); echo "OK.\n\n"; ?> It gets to the echo "Reading response:\n\n"; and then PHP crashes, and I get the Windows XP message asking if I would like to send Microsoft a bug report. I have several times. Maybe they will respond :-) -- Edit bug report at http://bugs.php.net/?id=20874&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=20874&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=20874&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=20874&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=20874&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=20874&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=20874&r=support Expected behavior: http://bugs.php.net/fix.php?id=20874&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=20874&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=20874&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=20874&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20874&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=20874&r=dst IIS Stability: http://bugs.php.net/fix.php?id=20874&r=isapi