[PHP-DEV] RE: Bug #10738 Updated: socket functions cause php4 to segmentation fault
Jani-- I can't compile the latest snapshot for some reason, weird errors come out: Making all in Zend lex -Pzend -ozend_language_scanner.c -i ./zend_language_scanner.l lex: illegal option -- P Usage: lex [-ewctvnVY] [-Q(y/n)] [file] *** Error code 1 make: Fatal error: Command failed for target `zend_language_scanner.c' Current working directory /root/src/php/php4-200105100645/Zend *** Error code 1 make: Fatal error: Command failed for target `all-recursive' If there is anything different between the latest snap shot and the way the live one on the website is, please let me know so I can make the changes..I'm just trying to do a basic install. Thanks.. ng -Original Message- From: Bug Database [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 4:20 AM To: [EMAIL PROTECTED] Subject: Bug #10738 Updated: socket functions cause php4 to segmentation fault ID: 10738 Updated by: sniper Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: Sockets related Operating system: PHP Version: 4.0.5 Assigned To: Comments: This should be fixed in CVS. Please try the latest snapshot from http://snaps.php.net/ Reopen it still segfaults. --Jani Previous Comments: --- [2001-05-09 00:42:42] [EMAIL PROTECTED] Ok, I think the problem was I was strip'ing the binary before moving it around. Try this: gdb ./php core GNU gdb 19981224 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as sparc-sun-solaris2.7... warning: core file may not match specified executable file. Core was generated by `./php ./mysocket.cgi'. Program terminated with signal 11, Segmentation Fault. Reading symbols from /usr/lib/libpam.so.1...done. Reading symbols from /usr/lib/libdl.so.1...done. Reading symbols from /usr/local/lib/libpng.so.2...done. Reading symbols from /usr/lib/libresolv.so.2...done. Reading symbols from /usr/lib/libm.so.1...done. Reading symbols from /usr/lib/libcrypt_i.so.1...done. Reading symbols from /usr/lib/libnsl.so.1...done. Reading symbols from /usr/lib/libsocket.so.1...done. Reading symbols from /usr/lib/libc.so.1...done. Reading symbols from /usr/local/lib/libucb.so.1...done. Reading symbols from /usr/lib/libelf.so.1...done. Reading symbols from /usr/lib/libgen.so.1...done. Reading symbols from /usr/lib/libmp.so.2...done. Reading symbols from /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1...done. Reading symbols from /usr/lib/nss_files.so.1...done. #0 0xff0b6dec in strlen () (gdb) bt #0 0xff0b6dec in strlen () #1 0x797a4 in php_if_strerror (ht=1, return_value=0x246618, this_ptr=0x0, return_value_used=1) at sockets.c:1097 #2 0x17c704 in execute () #3 0x11d7c0 in zend_execute_scripts (type=8, file_count=3) at zend.c:743 #4 0x36414 in php_execute_script (primary_file=0xffbefc58) at main.c:1209 #5 0x32c48 in main (argc=2, argv=0xffbefcfc) at cgi_main.c:730 --- [2001-05-08 16:34:49] [EMAIL PROTECTED] I think the '--enable-debug' didn't get accounted for. Please try deleting config.cache and reconfigure/compile PHP again. Then generate that gdb bactrace. Hopefully it will have more info in it. --Jani --- [2001-05-08 15:57:51] [EMAIL PROTECTED] I recently wanted to do socket based options with PHP4, so I downloaded PHP 4.0.5, compiled it fine. However when I attempted to run the Ex2 Socket Example: Simple TCP/IP client located at http://www.php.net/manual/en/ref.sockets.php PHP 4 core dumped: ../mysocket.cgi X-Powered-By: PHP/4.0.5 Content-type: text/html h2TCP/IP Connection/h2 l core Segmentation fault (core dumped) I recompiled PHP4 with the --enable-debug ('./configure' '--with-mysql=/usr/local/mysql' '--with-gd' '--with-zlib' '--with-png' '--with-xml' '--enable-ftp' '--enable-sockets' '--enable-discard-path' '--enable-debug') and analyzed the core: gdb /home/usr/bin/php4 core GNU gdb 19981224 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as sparc-sun-solaris2.7...(no debugging symbols found)... warning: core file may not match specified executable file. Core was generated by `/home/usr/bin/php4 ./mysocket.cgi'. Program terminated with signal 11, Segmentation Fault. Reading symbols from /usr/lib/libpam.so.1...(no debugging symbols found)...done. Reading symbols from
[PHP-DEV] RE: Bug #10738 Updated: socket functions cause php4 to segmentation fault
Ok, I think the problem was I was stripping the binary before moving it around. Try this: gdb ./php core GNU gdb 19981224 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as sparc-sun-solaris2.7... warning: core file may not match specified executable file. Core was generated by `./php ./mysocket.cgi'. Program terminated with signal 11, Segmentation Fault. Reading symbols from /usr/lib/libpam.so.1...done. Reading symbols from /usr/lib/libdl.so.1...done. Reading symbols from /usr/local/lib/libpng.so.2...done. Reading symbols from /usr/lib/libresolv.so.2...done. Reading symbols from /usr/lib/libm.so.1...done. Reading symbols from /usr/lib/libcrypt_i.so.1...done. Reading symbols from /usr/lib/libnsl.so.1...done. Reading symbols from /usr/lib/libsocket.so.1...done. Reading symbols from /usr/lib/libc.so.1...done. Reading symbols from /usr/local/lib/libucb.so.1...done. Reading symbols from /usr/lib/libelf.so.1...done. Reading symbols from /usr/lib/libgen.so.1...done. Reading symbols from /usr/lib/libmp.so.2...done. Reading symbols from /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1...done. Reading symbols from /usr/lib/nss_files.so.1...done. #0 0xff0b6dec in strlen () (gdb) bt #0 0xff0b6dec in strlen () #1 0x797a4 in php_if_strerror (ht=1, return_value=0x246618, this_ptr=0x0, return_value_used=1) at sockets.c:1097 #2 0x17c704 in execute () #3 0x11d7c0 in zend_execute_scripts (type=8, file_count=3) at zend.c:743 #4 0x36414 in php_execute_script (primary_file=0xffbefc58) at main.c:1209 #5 0x32c48 in main (argc=2, argv=0xffbefcfc) at cgi_main.c:730 -Original Message- From: Bug Database [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 3:35 PM To: [EMAIL PROTECTED] Subject: Bug #10738 Updated: socket functions cause php4 to segmentation fault ID: 10738 Updated by: sniper Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: Reproducible crash Operating system: PHP Version: 4.0.5 Assigned To: Comments: I think the '--enable-debug' didn't get accounted for. Please try deleting config.cache and reconfigure/compile PHP again. Then generate that gdb bactrace. Hopefully it will have more info in it. --Jani Previous Comments: --- [2001-05-08 15:57:51] [EMAIL PROTECTED] I recently wanted to do socket based options with PHP4, so I downloaded PHP 4.0.5, compiled it fine. However when I attempted to run the Ex2 Socket Example: Simple TCP/IP client located at http://www.php.net/manual/en/ref.sockets.php PHP 4 core dumped: ../mysocket.cgi X-Powered-By: PHP/4.0.5 Content-type: text/html h2TCP/IP Connection/h2 l core Segmentation fault (core dumped) I recompiled PHP4 with the --enable-debug ('./configure' '--with-mysql=/usr/local/mysql' '--with-gd' '--with-zlib' '--with-png' '--with-xml' '--enable-ftp' '--enable-sockets' '--enable-discard-path' '--enable-debug') and analyzed the core: gdb /home/usr/bin/php4 core GNU gdb 19981224 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as sparc-sun-solaris2.7...(no debugging symbols found)... warning: core file may not match specified executable file. Core was generated by `/home/usr/bin/php4 ./mysocket.cgi'. Program terminated with signal 11, Segmentation Fault. Reading symbols from /usr/lib/libpam.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libdl.so.1...(no debugging symbols found)...done. Reading symbols from /usr/local/lib/libpng.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/libresolv.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/libm.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libcrypt_i.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libnsl.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libsocket.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libc.so.1...(no debugging symbols found)...done. Reading symbols from /usr/local/lib/libucb.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libelf.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libgen.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/libmp.so.2...(no debugging symbols found)...done. Reading symbols from /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1...(no