分析 Apache/PHP 核心转储

发布于 2024-10-05 19:57:12 字数 556 浏览 1 评论 0原文

我偶尔会从 apache 收到 Seg 错误,因此我在服务器上启用了核心转储,以尝试找出发生了什么情况。昨晚我又得到了一个,并试图检查核心转储以找出发生了什么。这绝对是一个 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.

对于导致 seg 错误的 PHP 脚本,我应该在 dump_bt executor_globals.current_execute_data 之后获得回溯,但我保留改为尝试提取不是结构的值的组件。

I have been getting the occasional Seg Fault from apache so I enabled core dump on my servers to try to figure out what is going on. Last night I got another one and was trying to examine the core dump to find out what's going on. It's definitely a PHP process so I Googled how to examine these specifically for PHP. I downloaded the .gdbinit file for PHP 5.2 and I ran the following on the dump file:

$ 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.

I should be getting a backtrace after dump_bt executor_globals.current_execute_data for the PHP script that caused the seg fault, but I keep getting Attempt to extract a component of a value that is not a structure. instead.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

预谋 2024-10-12 19:57:12

我第一次和你遇到同样的问题。再次运行 btdump_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 

At the first time, I got the same problem with you. Run again the bt and dump_bt commands and it works:

(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 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文