我从apache偶尔遇到Seg Fault,所以我在服务器上启用了核心转储,试图弄清楚发生了什么。昨晚我又买了一个,试图检查核心转储,找出发生了什么。它绝对是一个PHP进程,因此我用Google搜索了如何专门针对PHP进行检查。我下载了PHP 5.2的.gdbinit文件,并在转储文件上运行了以下命令:
$ gdb apache2 dumpfile
[reading/loading symbols]
(gdb) bt
[...backtrace...]
(gdb) source ~/.gdbinit
(gdb) dump_bt executor_globals.current_execute_data
Attempt to extract a component of a value that is not a structure.
我应该在dump_bt executor_globals.current_execute_data
之后获得导致seg错误的PHP脚本的回溯,但我不断得到Attempt to extract a component of a value that is not a structure.
。
答案 0 :(得分:1)
第一次,我遇到了同样的问题。再次运行 bt 和 dump_bt 命令,它可以正常运行:
(gdb) dump_bt executor_globals.current_execute_data
Attempt to extract a component of a value that is not a structure.
(gdb) bt
#0 0x00002af8f874a5da in AppendImages () from /usr/lib64/libMagick.so.10
#1 0x00002af8f84586ce in MagickAppendImages () from /usr/lib64/libWand.so.10
#2 0x00002af8f81a3ad8 in zim_imagick_appendimages (ht=<value optimized out>, return_value=0x2af8f9ded108,
return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>)
at /var/tmp/imagick/imagick_class.c:8790
(gdb) dump_bt executor_globals.current_execute_data
[0xe8609940] appendimages() /var/www/html/xx/yy.php:803
[0xe8605070] genCode() /var/www/html/xx/zz.php:127