ports/125476: lang/php5 segmentation fault after running any command line php script

Nick Barkas snb at threerings.net
Thu Jul 10 16:00:14 UTC 2008


>Number:         125476
>Category:       ports
>Synopsis:       lang/php5 segmentation fault after running any command line php script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 10 16:00:12 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Nick Barkas
>Release:        FreeBSD 6.3-RELEASE-p2 amd64
>Organization:
Three Rings Design
>Environment:
System: FreeBSD wiki1.luna.threerings.net 6.3-RELEASE-p2 FreeBSD 6.3-RELEASE-p2 #0: Wed Jun 18 21:48:11 PDT 2008     root at wiki1.luna.threerings.net:/usr/obj/usr/src/sys/SMP  amd64

PHP packages installed:
php5
php5-dom
php5-iconv
php5-ldap
php5-mbstring
php5-mysql
php5-pcre
php5-readline
php5-session
php5-simplexml
php5-spl
php5-xml
php5-zlib

/var/db/ports/php5/options:
# This file is auto-generated by 'make config'.
# No user-servicable parts inside!
# Options for php5-5.2.6
_OPTIONS_READ=php5-5.2.6
WITH_CLI=true
WITHOUT_CGI=true
WITH_APACHE=true
WITHOUT_DEBUG=true
WITH_SUHOSIN=true
WITHOUT_MULTIBYTE=true
WITH_IPV6=true
WITHOUT_MAILHEAD=true
WITHOUT_REDIRECT=true
WITHOUT_DISCARD=true
WITHOUT_FASTCGI=true
WITHOUT_PATHINFO=true

>Description:
PHP seg faults whenever I run a command line script, no matter what the script
is. It seems to properly execute everything in the script and just crashes when
it finishes up. I'm also using mod_php with Apache to serve MediaWiki on this
same machine, and that seems to work just fine as well. It's just the PHP CLI
that appears to have trouble. Here is a backtrace from gdb of the core file 
created:

snb at wiki1> gdb -c /var/cores/10038-6112-php.core /usr/local/bin/php
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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 "amd64-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /lib/libm.so.4...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /usr/local/lib/libxml2.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Reading symbols from /lib/libz.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.3
Reading symbols from /usr/local/lib/libiconv.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/local/lib/libsasl2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libsasl2.so.2
Reading symbols from /usr/local/lib/libldap-2.3.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libldap-2.3.so.2
Reading symbols from /usr/local/lib/liblber-2.3.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/liblber-2.3.so.2
Reading symbols from /usr/lib/libssl.so.4...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libssl.so.4
Reading symbols from /lib/libcrypto.so.4...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypto.so.4
Reading symbols from /usr/local/lib/php/20060613/session.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/php/20060613/session.so
Reading symbols from /usr/local/lib/nss_ldap.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/nss_ldap.so.1
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000804343ba7 in __do_global_dtors_aux ()
   from /usr/local/lib/php/20060613/session.so
#2  0x000000080434a861 in _fini () from /usr/local/lib/php/20060613/session.so
#3  0x000000000076c8c0 in zval_used_for_init ()
#4  0x000000080071b3d4 in elf_hash () from /libexec/ld-elf.so.1
#5  0x000000080071e2d7 in dlclose () from /libexec/ld-elf.so.1
#6  0x0000000000518406 in zend_hash_apply_deleter ()
#7  0x000000000051849e in zend_hash_graceful_reverse_destroy ()
#8  0x000000000050c037 in zend_shutdown ()
#9  0x00000000004c950a in php_module_shutdown ()
#10 0x000000000059f001 in main ()

I don't know how useful this will be since PHP was not built with debugging
symbols. If I reinstall the port with WITH_DEBUG=true, strangely enough the
problem goes away--the PHP CLI no longer crashes.

>How-To-Repeat:
Even a very simple script can trigger this. For example:

snb at wiki1> cat foo.php
<?php echo "hello world\n"; ?>
snb at wiki1> php foo.php
hello world
zsh: segmentation fault (core dumped)  php foo.php
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list