ID: 29431 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Network related Operating System: Linux 2.4 PHP Version: 5.1.0-cvs New Comment:
Please try the script I posted. Paste it's output. If it doesn't work, run it using: strace -e trace=net php udp.php and paste that output too. Previous Comments: ------------------------------------------------------------------------ [2004-07-30 21:05:49] [EMAIL PROTECTED] Yep! I've done a cvsclean (and a cvs update) and re-compiled everything, and still get the same backtrace/error. ------------------------------------------------------------------------ [2004-07-30 19:23:35] [EMAIL PROTECTED] Works flawlessly here; are you sure you're running head? udp.php: <?php $socket = stream_socket_server("udp://127.0.0.1:1113", $errno, $errstr, STREAM_SERVER_BIND); if (!$socket) die("$errstr ($errno)"); do { $pkt = stream_socket_recvfrom($socket, 1, 0, $peer); print_r($pkt); print_r($peer); stream_socket_sendto($socket, date("D M j H:i:s Y\r\n"), 0, $peer); } while ($pkt !== false); ?> % php udp.php & % php -r '$f = fsockopen("udp://127.0.0.1", 1113); fwrite($f, 'x'); var_dump(fgets($f));' ------------------------------------------------------------------------ [2004-07-30 18:13:33] [EMAIL PROTECTED] It doesn't segfault, but... doesn't work. I think stream_socket_recvfrom() ins't populating $peer "Warning: stream_socket_sendto()]: Invalid argument in /transfer/a.php on line 11" gdb output: Program received signal SIGINT, Interrupt. 0x4037e6c2 in select () from /lib/libc.so.6 (gdb) bt #0 0x4037e6c2 in select () from /lib/libc.so.6 #1 0x082beddc in __JCR_LIST__ () #2 0xbfffd2b8 in ?? () #3 0xbfffd340 in ?? () #4 0x081c9c3d in php_sock_stream_wait_for_data (stream=0x836e95c, sock=0x83640cc) at /cvs/php-src/main/streams/xp_socket.c:100 #5 0x081c9c8f in php_sockop_read (stream=0x836e95c, buf=0x836eb14 "", count=8192) at /cvs/php-src/main/streams/xp_socket.c:120 #6 0x081c191e in php_stream_fill_read_buffer (stream=0x836e95c, size=1) at /cvs/php-src/main/streams/streams.c:530 #7 0x081c1c34 in _php_stream_read (stream=0x836e95c, buf=0x836412c "", size=1) at /cvs/php-src/main/streams/streams.c:573 #8 0x081c998f in php_stream_xport_recvfrom (stream=0x836e95c, buf=0x836412c "", buflen=1, flags=0, addr=0x0, addrlen=0xfffffdfe, textaddr=0x836ea44, textaddrlen=0xfffffdfe) at /cvs/php-src/main/streams/transports.c:391 #9 0x081a4fee in zif_stream_socket_recvfrom (ht=4, return_value=0x8370b7c, this_ptr=0x0, return_value_used=1) at /cvs/php-src/ext/standard/streamsfuncs.c:328 #10 0x082096d9 in zend_do_fcall_common_helper (execute_data=0xbfffd630, opline=0x837322c, op_array=0x836e88c) at /cvs/php-src/Zend/zend_execute.c:2699 #11 0x0820983a in zend_do_fcall_handler (execute_data=0xbfffd630, opline=0x837322c, op_array=0x836e88c) at /cvs/php-src/Zend/zend_execute.c:2831 #12 0x08206068 in execute (op_array=0x836e88c) at /cvs/php-src/Zend/zend_execute.c:1391 #13 0x081e9dca in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /cvs/php-src/Zend/zend.c:1068 #14 0x081b4440 in php_execute_script (primary_file=0xbffffa00) at /cvs/php-src/main/main.c:1631 #15 0x08210f80 in main (argc=2, argv=0xbffffa94) at /cvs/php-src/sapi/cli/php_cli.c:943 ------------------------------------------------------------------------ [2004-07-29 01:31:31] [EMAIL PROTECTED] Fixed in HEAD. ------------------------------------------------------------------------ [2004-07-29 01:00:25] [EMAIL PROTECTED] Does it segfault if you disable the sockets extension? (Looking into your script now, but the valgrind output indicates that ext/sockets is still a bad choice) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29431 -- Edit this bug report at http://bugs.php.net/?id=29431&edit=1