I am attempting to debug a SIGSEGV on PHP on my Ubuntu 9.10.
I've installed php5-dbg to have the debug symbols available, however, when I start gdb, it shows the following output:
Reading symbols from /usr/bin/php... Reading symbols from /usr/lib/debug/usr/bin/php5...done. (no debugging symbols found)...done. Any ideas are welcome.
41 Answer
Under certain situations, the -dbg packages don't work correctly. Instead, try the -dbgsym packages, available from the separate "debug symbols" repository:
However, when trying this locally with Ubuntu 9.10, I have no problem loading symbols using the existing php5-dbg package. Perhaps make sure you have the latest updates installed first, and then try it?
As an example:
$ cat /tmp/test.php <?php sleep(10); ?> $ gdb php ... (gdb) run /tmp/test.php ... ^C Program received signal SIGINT, Interrupt. 0xf7fe0430 in __kernel_vsyscall () (gdb) bt #0 0xf7fe0430 in __kernel_vsyscall () #1 0xf7a13b50 in nanosleep () from /lib/tls/i686/cmov/libc.so.6 #2 0xf7a13991 in sleep () from /lib/tls/i686/cmov/libc.so.6 #3 0x081fbfc1 in zif_sleep (ht=1, return_value=0x866d204, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /build/buildd/php5-5.2.10.dfsg.1/ext/standard/basic_functions.c:4787 #4 0x082f9616 in zend_do_fcall_common_helper_SPEC (execute_data=0xffffafbc) at /build/buildd/php5-5.2.10.dfsg.1/Zend/zend_vm_execute.h:200 #5 0x082f511b in execute (op_array=0x866d7f0) at /build/buildd/php5-5.2.10.dfsg.1/Zend/zend_vm_execute.h:92 #6 0x082cf414 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /build/buildd/php5-5.2.10.dfsg.1/Zend/zend.c:1215 #7 0x08284166 in php_execute_script (primary_file=0xffffd454) at /build/buildd/php5-5.2.10.dfsg.1/main/main.c:2046 #8 0x08352c38 in main (argc=2, argv=0xffffd554) at /build/buildd/php5-5.2.10.dfsg.1/sapi/cli/php_cli.c:1170 1