From:             [EMAIL PROTECTED]
Operating system: SunOS 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-250
PHP version:      4.0.5
PHP Bug Type:     Reproducible crash
Bug description:  socket functions cause php4 to segmentation fault

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


<h2>TCP/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 debugging 
symbols found)...done.
Reading symbols from /usr/lib/nss_files.so.1...(no debugging symbols found)...done.
#0  0xff0b6dec in strlen ()
(gdb) bt
#0  0xff0b6dec in strlen ()
#1  0x797a4 in php_if_strerror ()
#2  0x17c704 in execute ()
#3  0x11d7c0 in zend_execute_scripts ()
#4  0x36414 in php_execute_script ()
#5  0x32c48 in main ()

If you truss it, this is the last thing you see:

open64("/etc/.name_service_door", O_RDONLY)     = 3
fcntl(3, F_SETFD, 0x00000001)                   = 0
door_info(3, 0xFF13A460)                        = 0
door_call(3, 0xFFBEBE78)                        = 0
so_socket(2, 2, 0, "", 1)                       = 4
    Incurred fault #6, FLTBOUNDS  %pc = 0xFF0B6DEC
      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
    Received signal #11, SIGSEGV [default]
      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
        *** process killed ***

Please let me know what other information you may need.


-- 
Edit Bug report at: http://bugs.php.net/?id=10738&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to