When emerging php with the "debug" USE flag, I am still unable to produce a usable backtrace. I need a backtrace in order to file a bug with bugs.php.net. I'm merging php-5.1.4-r6 (I have also tried php-5.1.6-r2). I've tried compiling with and without fastbuild as well. [ebuild R ] dev-lang/php-5.1.4-r6 USE="apache2 berkdb bzip2 cli crypt debug fastbuild* ftp gd gdbm kerberos ldap memlimit mssql mysql ncurses nls pcre pdo-external postgres readline reflection session simplexml snmp soap sockets spell spl sqlite ssl tidy tokenizer xml xpm xsl zlib -..." 0 kB This is what I get from gdb *after* emerging php with USE="debug": ---- # php -e test.php done searching Segmentation fault (core dumped) # gdb php core GNU gdb 6.4 ..snip.. (gdb) bt #0 0x00002aaaac8cbf4b in ?? () #1 0x55a1ee92ad8531f0 in ?? () #2 0x0000555555dbe260 in ?? () #3 0x0000555555de16c0 in ?? () #4 0x00005555556a92b5 in ?? () #5 0x000000000000000f in ?? () #6 0x0000000000000001 in ?? () #7 0x000000000000000f in ?? () #8 0x00002aaaaea76cf0 in ?? () #9 0x0000000000000003 in ?? () #10 0x0000000000000000 in ?? () ---- # emerge --info Portage 2.1-r2 (default-linux/amd64/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.15-gentoo-r5 x86_64) ================================================================= System uname: 2.6.15-gentoo-r5 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ Gentoo Base System version 1.6.15 app-admin/eselect-compiler: [Not Present] dev-lang/python: 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] 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-r2 sys-devel/binutils: 2.16.1-r3 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-mtune=athlon64 -msse2 -O3 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LINGUAS="en" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 acl alsa amd64 apache2 automount avi bash-completion berkdb bitmap-fonts bzip2 cdr cli crypt dlloader dri dvd dvdr eds emboss encode fastbuild firefox flash foomaticdb fortran ftp gd gdbm gif gksu glut gnome gpm gstreamer gtk gtk2 hal imlib input_drivers_evdev isdnlog java jpeg jpeg2k kdeenablefinal kerberos ldap ldapsam linguas_en linguas_en_US lm_sensors logrotate lzw lzw-tiff memlimit mozilla mp3 mpeg mplayer mssql mysql ncurses new-login nls nptl nsplugin nvidia offensive opengl pam pcre pdflib pdo-external perl png postgres pppd python qt3 qt4 quicktime quotas readline reflection samba sametime sdl session sftp sftplogging simplexml snmp soap sockets spell spl sqlite ssl syslog tcpd tidy tiff tokenizer truetype-fonts type1-fonts usb video_cards_nvidia winbind xine xinerama xml xmms xorg xpm xsl xv zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux userland_GNU video_cards_nv video_cards_vesa" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY # cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 35 model name : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ stepping : 2 cpu MHz : 2010.339 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy bogomips : 4024.78 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 35 model name : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ stepping : 2 cpu MHz : 2010.339 cache size : 512 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy bogomips : 4020.89 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp
http://www.gentoo.org/proj/en/qa/backtraces.xml
I appreciate the link. I was under the impression that the debug USE flag would set the appropriate flags and configure options. That said, I tried re-emerging PHP with the following: FEATURES="splitdebug" ACCEPT_KEYWORDS=~amd64 USE="debug" CFLAGS="-mtune=athlon64 -msse2 -O1 -ggdb" emerge -v php And I still get a backtrace with nothing but addresses. I'll keep trying different combinations, but at this point even with that link you gave me, I'm still at the same place I started...
You need nostrip in FEATURES unless you are using debugedit for your debugging w/ the splitdebug stuff. And, recompiling PHP itself won't do much good, you should recompile all its dependencies as well to get some useful results.
Okay (the difference between "splitdebug" and "nostrip" needs to be clarified better on that link -- it makes no mention to "debugedit", and says that the result of using "splitdebug" will allow gdb to find the debug information automatically... which is apparently incorrect?) I'm trying it with nostrip now. Thanks again.
Okay, after re-emerging PHP and OpenLDAP with: FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict nostrip" ACCEPT_KEYWORDS=~amd64 USE="debug" CFLAGS="-mtune=athlon64 -O1 -ggdb" CXXFLAGS="-mtune=athlon64 -O1 -ggdb" emerge -vD php openldap I still get a useless backtrace... What am I missing now? I understand that it would be best to recompile all of PHP's dependencies, but the only debugging information I'm interested in is PHP's and ldap's (the crash happens on ldap_get_entries). And even after the way i've just merged PHP and OpenLDAP, at least PART of the backtrace should give some useful information, right? Instead I *still* only get this: --------- # gdb php (gdb) set args -e test.php (gdb) run Starting program: /usr/bin/php -e test.php done searching Program received signal SIGSEGV, Segmentation fault. 0x00002aaaac8ccd1d in ?? () (gdb) thread apply bt all (gdb) bt #0 0x00002aaaac8ccd1d in ?? () #1 0xa3a75fcdd6da6987 in ?? () #2 0x0000000000000410 in ?? () #3 0x0000555555ee7c90 in ?? () #4 0x00005555556a25f0 in ?? () #5 0x0000000000000024 in ?? () #6 0x00005555558085c2 in ?? () #7 0x0000555555ba3488 in ?? () #8 0x00005555558183c9 in ?? () #9 0xa3a75fcdd6da6987 in ?? () #10 0x0000000000000000 in ?? () ----------- What am I missing here? And why does it have to be so difficult just to get a simple backtrace?
Please, don't use bugzilla as a support forum, it's really not proper place to ask questions how to do something.
Well, I don't consider this a problem of simply not doing something right. I've done what the backtraces.xml document says is required to create a useful backtrace, and still no backtrace is generated, therefore I consider it a BUG (which is what BUGzilla is for, right?).
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms splitdebug strict" ACCEPT_KEYWORDS="~amd64" USE="debug" CFLAGS="-mtune=athlon64 -O2 -pipe -ggdb" CXXFLAGS="-mtune=athlon64 -O2 -pipe -ggdb" emerge -vD openldap php That's what I do on my debugging system and it definitely _does_ work, the "debug" USE flag in PHP does enable it's debugging features, there's nothing broken here, closing this... Best regards, CHTEKK.