Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120202 - dev-lang/php-5.1.1 cli segmentation faults
Summary: dev-lang/php-5.1.1 cli segmentation faults
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL: http://bugs.php.net/bug.php?id=36182
Whiteboard: watch-php-bugzilla
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 10:18 UTC by Erik Zeek
Modified: 2006-01-30 11:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Zeek 2006-01-24 10:18:16 UTC
The commandline PHP5 interface seg faults, apparently on exit.  (mod_php seems to work fine.  Apache runs and my website works.)  It seg faults even just running php -v.

Let me know if there is any more information that I can provide.

gdb --args php -v
GNU gdb 6.4
Copyright 2005 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 "i686-pc-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/php -v
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1209047360 (LWP 20522)]
PHP 5.1.1-gentoo (cli) (built: Jan 24 2006 12:01:06) (DEBUG)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209047360 (LWP 20522)]
0xb7b85249 in ?? ()
(gdb) where
#0  0xb7b85249 in ?? ()
#1  0x081ea9db in tsrm_shutdown ()
#2  0x082f7bec in main ()
(gdb)


emerge -pv dev-lang/php

These are the packages that I would merge, in order:

Calculating dependencies      ...done!
[ebuild   R   ] dev-lang/php-5.1.1  USE="apache2 bcmath berkdb bzip2 calendar cgi cli crypt ctype curl curlwrappers dba debug discard-path exif flatfile force-cgi-redirect ftp gd gdbm gmp iconv imap inifile ipv6 ldap mhash ming mysql ncurses nls pcntl pcre pic posix readline sasl sharedext sockets spell spl sqlite ssl sysvipc threads tidy tokenizer truetype xml xpm xsl zip zlib -adabas -apache -birdstep -cdb -cjk -db2 -dbase -dbmaker -doc -empress -empress-bcs -esoob -fastbuild -fdftk -filepro -firebird -frontbase -gd-external -hardenedphp -hyperwave-api -informix -interbase -iodbc -java-external -kerberos -libedit -mcve -memlimit -msql -mssql -mysqli -oci8 -oci8-instant-client -odbc -pdo -pdo-external -postgres -qdbm -recode -sapdb -session -sharedmem -simplexml -snmp -soap -solid -sybase -sybase-ct -vm-goto -vm-switch -wddx -xmlreader -xmlrpc -yaz" 0 kB


emerge info
Portage 2.1_pre3-r1 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.6-r2, 2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.12.0_pre15
ccache version 2.4 [enabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mtune=prescott -march=prescott -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mtune=prescott -march=prescott -pipe"
DISTDIR="/home/gentoo/portage/distfiles"
FEATURES="autoconfig candy ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/"
LINGUAS="en-US"
MAKEOPTS="-j2"
PKGDIR="/home/gentoo/portage/packages"
PORTAGE_TMPDIR="/home/gentoo/tmp"
PORTDIR="/home/gentoo/portage"
PORTDIR_OVERLAY="/home/gentoo/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 7zip X X509 Xaw3d a52 aac aalib acl acpi activefilter ada aim aio alsa amarok amd amr aotuv apache2 apm arts artswrappersuid artworkextra asf asm asterisk async atlas auctex audiofile authdaemond automount avi bash-completion bcmath bcp bdf berkdb bitmap-fonts bjam bl blas blender-game bonobo boo bzip2 c++ cairo calendar cap caps ccache cdda cddb cdf cdio cdparanoia cdr cdrom cgi chm clanJavaScript clanVoice cli clisp cmucl commercial corba cpdflib cracklib crosscompile crypt cscope css ctype cups curl curlwrappers cvsgraph daap dba dbm dbus dbx dcc debugger dga dhcp dio directfb discard-path dnd dpms dri dts dv dvd dvdr dvdread dynagraph ecc editor edl eds effects emboss emoticon encode enscript epson erandom esd examples exif expat extraicons extramodules fam fame fat fbcon fbdev fbsplash ffmpeg fftw finger firefox fits flac flash flatfile fltk font-server fontconfig foomaticdb force-cgi-redirect fortran fpx freetts freetype ftp fuse gb gcc-libffi gcj gcl gd gdal gdbm geoip geos ggi gif gimp gimpprint ginac gitsendemail gkrellm glade glep glgd glitz glut glx gml gmp gmtfull gmthigh gmtsuppl gmttria gnome gnome-print gnomedb gnuplot gnutls gpgme gphoto2 gpm gps graphviz grass gs gsl gssapi gstreamer gtk gtk2 gtkhtml guile gzip hal haskell hddtemp hdf hdf5 hfs high-ints hlapi hou hpn html httpd i8x0 iconv icq id3 ide idea idn image imagemagick imap imlib imlib2 inifile inkjar insecure-drivers insecure-savers ipv6 itcl jack jai jasper java javacomm javascript jbig jce jikes jimi jit jp2 jpeg jpeg2k junit jython kcal kde kdeenablefinal kdepim kdexdeltas kqemu ladcca lame lapack largeterminal latex lcms ldap libcaca libclamav libdsk libg++ libgda libsamplerate libwww live lm_sensors logitech-mouse logrotate logwatch lua lzo lzw mad mail maildir mailwrapper mapeditor maps math matroska mbrola md5sum mhash mikmod mime ming mixer mjpeg mmap mmx mmxext mng mod mopac7 motif mozilla moznocompose moznoirc moznomail mozsha1 mozsvg mp3 mp4live mpeg mpeg2 mpeg4 mplayer mpqc multiprocess multitarget musepack music musicbrainz mysql nas ncurses net netcdf network new-login nfs nls no-old-linux nocd nowin nptl nsplugin ntfs ntlm numarray numeric oav objc ocaml octave offensive ofx ogdi ogg oggvorbis openal openbabel openexr opengl osc oss pam parse-clocks pascal patented pcntl pcre pdf pdfkit pdflib pear perl php physfs pic player plotutils plugin png pnp portaudio posix postfix povray ppds print pyste python qemu-fast qhull qt quicktime quotas quotes rar rdesktop readline real recode remix rle rogue rpc rrdtool rss rtc ruby samba sasl sbcl scanner scp screen sdk sdl seti sftp shared sharedext sharedmem shorten shout skins slp smime smp sndfile sockets softmmu sou sounds speedo speex spell spl sql sqlite sse sse-filters sse2 ssl stencil-buffer stream subject-rewrite subp subtitles subversion suid svg svgz symlink sysfs syslog sysvipc szip t1lib tcltk tcpd test tetex tga theora thesaurus threads tidy tiff timidity tokenizer toolbar tools transcode truetype truetype-fonts type1 type1-fonts ucs2 ucs4 udev unicode urandom usb userlocales utf8 uudeview v4l v4l2 vcd vcdimager vfat videos vidix vim-with-x virus-scan visualization vlm voice vorbis webdav win32codecs wmf wordperfect wv wxwindows x264 xanim xatrix xface xforms xine xinetd xml xml2 xmldoclet xmms xosd xpm xprint xscreensaver xsl xslt xtended xv xvid xvmc yv12 zip zlib elibc_glibc kernel_linux linguas_en-US userland_GNU"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-01-24 10:41:56 UTC
That gdb output is pretty much useless, please read http://www.gentoo.org/doc/en/bugzilla-howto.xml to learn how to compile php with debugging symbols and attach a backtrace then.
Comment 2 Erik Zeek 2006-01-24 11:16:18 UTC
(In reply to comment #1)
> That gdb output is pretty much useless, please read
> http://www.gentoo.org/doc/en/bugzilla-howto.xml to learn how to compile php
> with debugging symbols and attach a backtrace then.
> 

Hmm...  Followed those directions and it didn't get much better.  Is there another library I should install with nostrip?

Emerging with:

CFLAGS="-O0 -pipe -g -ggdb" CXXFLAGS="-O0 -pipe -g -ggdb" FEATURES="nostrip" emerge -av dev-lang/php

yielded:

gdb --args php -v
GNU gdb 6.4
Copyright 2005 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 "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/php -v
[Thread debugging using libthread_db enabled]
[New Thread -1209125184 (LWP 2738)]
PHP 5.1.1-gentoo (cli) (built: Jan 24 2006 13:59:03) (DEBUG)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209125184 (LWP 2738)]
0xb7b427d6 in ?? ()
(gdb) bt
#0  0xb7b427d6 in ?? ()
#1  0x0821aa2d in tsrm_shutdown () at /home/gentoo/tmp/portage/php-5.1.1/work/php-5.1.1/TSRM/TSRM.c:180
#2  0x08317fe2 in main (argc=2, argv=0xbfb137a4) at /home/gentoo/tmp/portage/php-5.1.1/work/php-5.1.1/sapi/cli/php_cli.c:1152
(gdb)
Comment 3 Giampaolo Tomassoni 2006-01-29 08:01:19 UTC
Just discovered that this problem is due to the tidy extension in php.

If you remove /etc/php/cli-php5/ext-active/tidy.ini you should be able to issue 'php -v' without being bounced by a segfault error.

This is possible, of course, if you don't use any tidy function in your php pages...

Please note that the segfault trouble impaired the installation of dev-php/PEAR-DB-1.7.6-r1 until I disabled tidy, so I would like to leave this bug opened 'till the gentoo staff fixes the tidy problem.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-01-30 01:05:25 UTC
OK, please recompile without USE="threads" (you'll need to recompile apache as well) and test whether it still segfaults...
Comment 5 Erik Zeek 2006-01-30 09:08:27 UTC
(In reply to comment #3)
> If you remove /etc/php/cli-php5/ext-active/tidy.ini you should be able to issue
> 'php -v' without being bounced by a segfault error.
> 

This fixed the segfault.
Comment 6 Erik Zeek 2006-01-30 09:56:57 UTC
(In reply to comment #4)
> OK, please recompile without USE="threads" (you'll need to recompile apache as
> well) and test whether it still segfaults...
> 

This also fixed the segfault.
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2006-01-30 10:21:35 UTC
We don't support USE=threads in php (for reasons such as this one), please report this upstream (bugs.php.net) and post the URL here. It's most likely not fixed in 5.1.2 either, since the relevant code hasn't changed there.
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2006-01-30 10:22:14 UTC
Closing UPSTREAM, thanks for reporting back.
Comment 9 Erik Zeek 2006-01-30 10:58:41 UTC
(In reply to comment #7)
> We don't support USE=threads in php (for reasons such as this one), please
> report this upstream (bugs.php.net) and post the URL here. It's most likely not
> fixed in 5.1.2 either, since the relevant code hasn't changed there.
> 

Already reported in:
http://bugs.php.net/bug.php?id=36182