Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 310515 - xdebug-2.0.5: apache segfault on any PHP page
Summary: xdebug-2.0.5: apache segfault on any PHP page
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-21 11:26 UTC by Felix Leimbach
Modified: 2010-05-25 16:37 UTC (History)
1 user (show)

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 Felix Leimbach 2010-03-21 11:26:33 UTC
Running the latest stable apache (2.2.14-r1) and xdebug (2.0.5) results in a segfault every time I access any php page. Apache's error log shows:

[notice] child pid 24697 exit signal Segmentation fault (11)

This happens even on simple script which just calls phpinfo();

I've set apache to 1 thread and caught a backtrace with gdb:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f137cb35910 (LWP 24728)]
0x00007f137d56626d in xdebug_init_oparray () from /usr/lib64/php5/lib/php/extensions/debug-zts-20060613/xdebug.so
(gdb) bt
#0  0x00007f137d56626d in xdebug_init_oparray () from /usr/lib64/php5/lib/php/extensions/debug-zts-20060613/xdebug.so
#1  0x00007f1380ed09bb in ?? () from /usr/lib64/apache2/modules/libphp5.so
#2  0x00007f1380ed067a in zend_llist_apply_with_argument () from /usr/lib64/apache2/modules/libphp5.so
#3  0x00007f1380ed0ca4 in init_op_array () from /usr/lib64/apache2/modules/libphp5.so
#4  0x00007f1380ea0bf9 in compile_file () from /usr/lib64/apache2/modules/libphp5.so
#5  0x00007f137d56369c in xdebug_compile_file () from /usr/lib64/php5/lib/php/extensions/debug-zts-20060613/xdebug.so
#6  0x00007f1380edea63 in zend_execute_scripts () from /usr/lib64/apache2/modules/libphp5.so
#7  0x00007f1380e6a956 in php_execute_script () from /usr/lib64/apache2/modules/libphp5.so
#8  0x00007f1380f74786 in ?? () from /usr/lib64/apache2/modules/libphp5.so
#9  0x0000000000439c62 in ap_run_handler ()
#10 0x000000000043d15f in ap_invoke_handler ()
#11 0x0000000000447c48 in ap_process_request ()
#12 0x0000000000444d38 in ?? ()
#13 0x00000000004410a2 in ap_run_process_connection ()
#14 0x000000000044cff1 in ?? ()
#15 0x00007f1386cad2a7 in start_thread () from /lib/libpthread.so.0
#16 0x00007f13868196ad in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()

Interestingly I can run php scripts on the cli just fine with xdebug enabled. The xdebug config is the same file in /etc/php/apache2-php5/ext-active/xdebug.ini and /etc/php/cli-php5/ext-active/xdebug.ini

Happens also with the older xdebug-2.0.2 from portage.

Reproducible: Always

Steps to Reproduce:




Portage 2.1.7.17 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.32-gentoo-r6 x86_64)
=================================================================                               
System uname: Linux-2.6.32-gentoo-r6-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P7550_@_2.26GHz-with-gentoo-1.12.13
Timestamp of tree: Thu, 18 Mar 2010 18:30:01 +0000                                                        
app-shells/bash:     4.0_p35                                                                              
dev-java/java-config: 2.1.10                                                                              
dev-lang/python:     2.6.4-r1                                                                             
dev-util/cmake:      2.6.4-r3                                                                             
sys-apps/baselayout: 1.12.13                                                                              
sys-apps/sandbox:    1.6-r2                                                                               
sys-devel/autoconf:  2.13, 2.63-r1                                                                        
sys-devel/automake:  1.8.5-r3, 1.9.6-r2, 1.10.3                                                           
sys-devel/binutils:  2.18-r3                                                                              
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/ http://gentoo.mneisen.org/ http://de-mirror.org/distro/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/kde /usr/local/portage/layman/kde-sunset /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi ads aim aio alsa amazon amd64 bash-completion battery berkdb bittorrent bluetooth bonjour bzip2 cairo cdda cli consolekit cracklib crypt css cups curl cxx dar32 dbus dhcpcd dri dvd encode facebook ffmpeg flac fortran gdbm geoip gimp git gpm hal hbci hfs iconv iphone ipod isight java java6 jpeg jpeg2k kde kdehiddenvisibility kvm lame laptop ldap lzo mad mmx mng modules mono mp3 mp4 mpeg mpeg2 mplayer msn mudflap multilib ncurses networkmanager nls no-old-linux nptl nptlonly nsplugin ofx ogg opengl openmp pam pcre perl png pppd python qt3support qt4 quicktime rdesktiop rdp readline reflection rtsp samba sdl semantic-desktop session skype sox spl sql sqlite sse sse2 sse3 ssl startup-notification subversion svg sysfs tcpd theora threads tiff truetype udev unicode usb v4l2 vcd vnc vorbis webkit wifi x264 xorg xv xvid yahoo zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Doktor Notor 2010-03-21 12:43:05 UTC
Please read this howto: http://www.gentoo.org/proj/en/qa/backtraces.xml to see how to produce a more meaningful backtrace.
Comment 2 Felix Leimbach 2010-03-21 15:17:48 UTC
Sure, I've recompiled apache, php and xdebug with -ggdb and FEATURES=nostrip.
Here you go:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fda2f131910 (LWP 24996)]
0x00007fda2fb6226d in xdebug_init_oparray (op_array=0x170d878) at /var/tmp/portage/dev-php5/xdebug-2.0.5/work/xdebug-2.0.5/xdebug.c:3156
3156    /var/tmp/portage/dev-php5/xdebug-2.0.5/work/xdebug-2.0.5/xdebug.c: No such file or directory.
        in /var/tmp/portage/dev-php5/xdebug-2.0.5/work/xdebug-2.0.5/xdebug.c
(gdb) bt
#0  0x00007fda2fb6226d in xdebug_init_oparray (op_array=0x170d878) at /var/tmp/portage/dev-php5/xdebug-2.0.5/work/xdebug-2.0.5/xdebug.c:3156
#1  0x00007fda334cc9bb in zend_extension_op_array_ctor_handler (extension=0x1500e30, op_array=0x170d878, tsrm_ls=0x16e9330)
    at /var/tmp/portage/dev-lang/php-5.2.12/work/php-5.2.12/Zend/zend_opcode.c:35
#2  0x00007fda334cc67a in zend_llist_apply_with_argument (l=0x7fda33a7aec0, func=0x7fda334cc98c <zend_extension_op_array_ctor_handler>, arg=0x170d878,
    tsrm_ls=0x16e9330) at /var/tmp/portage/dev-lang/php-5.2.12/work/php-5.2.12/Zend/zend_llist.c:236
#3  0x00007fda334ccca4 in init_op_array (op_array=0x170d878, type=2 '\002', initial_ops_size=64, tsrm_ls=0x16e9330)
    at /var/tmp/portage/dev-lang/php-5.2.12/work/php-5.2.12/Zend/zend_opcode.c:106
#4  0x00007fda3349cbf9 in compile_file (file_handle=0x7fda2f130e70, type=8, tsrm_ls=0x16e9330)
    at /var/tmp/portage/dev-lang/php-5.2.12/work/php-5.2.12/Zend/zend_language_scanner.c:3417
#5  0x00007fda2fb5f69c in xdebug_compile_file (file_handle=0x7fda2f130e70, type=8, tsrm_ls=0x16e9330)
    at /var/tmp/portage/dev-php5/xdebug-2.0.5/work/xdebug-2.0.5/xdebug.c:2405
#6  0x00007fda334daa63 in zend_execute_scripts (type=8, tsrm_ls=0x16e9330, retval=0x0, file_count=3)
    at /var/tmp/portage/dev-lang/php-5.2.12/work/php-5.2.12/Zend/zend.c:1126
#7  0x00007fda33466956 in php_execute_script (primary_file=0x7fda2f130e70, tsrm_ls=0x16e9330)
    at /var/tmp/portage/dev-lang/php-5.2.12/work/php-5.2.12/main/main.c:2036
#8  0x00007fda33570786 in php_handler (r=0x16ed9b8) at /var/tmp/portage/dev-lang/php-5.2.12/work/php-5.2.12/sapi/apache2handler/sapi_apache2.c:637
#9  0x0000000000439e02 in ap_run_handler (r=0x16ed9b8) at config.c:158
#10 0x000000000043d31f in ap_invoke_handler (r=0x16ed9b8) at config.c:372
#11 0x0000000000448028 in ap_process_request (r=0x16ed9b8) at http_request.c:282
#12 0x0000000000445108 in ap_process_http_connection (c=0x16e9bb0) at http_core.c:190
#13 0x0000000000441242 in ap_run_process_connection (c=0x16e9bb0) at connection.c:43
#14 0x000000000044d471 in process_socket (thd=0x14041d8, dummy=<value optimized out>) at worker.c:544
#15 worker_thread (thd=0x14041d8, dummy=<value optimized out>) at worker.c:894
#16 0x00007fda392aa2a7 in start_thread () from /lib/libpthread.so.0
#17 0x00007fda38e166ad in clone () from /lib/libc.so.6
#18 0x0000000000000000 in ?? ()
Comment 3 Felix Leimbach 2010-03-31 17:28:09 UTC
Upstream bug report: http://bugs.xdebug.org/view.php?id=554
The crash is solved in SVN 3241 and maybe in the xdebug 2.1 betas/RCs.
So any xdebug-2.1 ebuild will probably solve this bug, too.
Comment 4 Matti Bickel (RETIRED) gentoo-dev 2010-05-01 19:27:20 UTC
I've just added 2.0.1_rc1 to the tree. I don't get any errors with this version. 
Thanks for reporting and taking this upstream.

Please reopen if you still have issues.
Comment 5 Christian Weiske 2010-05-24 05:32:56 UTC
I would like to reopen that bug - but am not allowed to.

xdebug-client has been bumped to 2.1.0_rc1, but the problem lies within "dev-php5/xdebug"! Also, the correct version is 2.1.0_rc1 not 2.0.1_rc1 as stated in the last comment.

The issue is not solved. Apache still crashes with PHP and xdebug enabled, because xdebug is still at version 2.0.5.
Comment 6 Matti Bickel (RETIRED) gentoo-dev 2010-05-24 08:54:40 UTC
My bad. We actually have both dev-php5/xdebug and dev-php/xdebug-client in our overlay and I just committed dev-php/xdebug-client.

The version in the bug was a typo, I really did 2.1.0_rc1 :-)
And now dev-php5/xdebug, too.
Comment 7 Christian Weiske 2010-05-25 16:37:54 UTC
Yes - that was it. Works great now.