PHP 5.3.6 段错误(在 apache w/mod_php 和 nginx w/fpm 中)
我在 PHP 5.3.6 中遇到了令人讨厌的段错误(从源代码、Slackware 13.1 x86、Linode 中的 VPS 编译)。它发生在 apache 和 nginx (fpm) 中。最后设法获得核心转储:
0 0x083db383 in _zval_ptr_dtor ()
1 0x083f3c45 in zend_hash_destroy ()
2 0x083e6fba in _zval_dtor_func ()
3 0x083da69a in _zval_dtor ()
4 0x083db3df in _zval_ptr_dtor ()
5 0x083f3c45 in zend_hash_destroy ()
6 0x083e6fba in _zval_dtor_func ()
7 0x083da69a in _zval_dtor ()
8 0x083db3df in _zval_ptr_dtor ()
9 0x083f3c45 in zend_hash_destroy ()
10 0x08406091 in zend_object_std_dtor ()
11 0x0840632e in zend_objects_free_object_storage ()
12 0x0840a44c in zend_objects_store_del_ref_by_handle_ex ()
13 0x0840a23b in zend_objects_store_del_ref ()
14 0x083e6fe1 in _zval_dtor_func ()
15 0x083da69a in _zval_dtor ()
16 0x083db3df in _zval_ptr_dtor ()
17 0x083f3c45 in zend_hash_destroy ()
18 0x08406091 in zend_object_std_dtor ()
19 0x0840632e in zend_objects_free_object_storage ()
20 0x0840a44c in zend_objects_store_del_ref_by_handle_ex ()
21 0x0840a23b in zend_objects_store_del_ref ()
22 0x083e6fe1 in _zval_dtor_func ()
23 0x083da69a in _zval_dtor ()
24 0x083db3df in _zval_ptr_dtor ()
25 0x083f3c45 in zend_hash_destroy ()
26 0x083e6fba in _zval_dtor_func ()
27 0x083da69a in _zval_dtor ()
28 0x083daed6 in shutdown_executor ()
29 0x083e86c8 in zend_deactivate ()
30 0x0838ebad in php_request_shutdown ()
31 0x084a3f26 in main ()
我正在使用 memcache、apc 和 mongo 扩展(从源代码编译)。我尝试禁用 apc,但没有成功。我的 PHP 配置:
./configure \
--prefix=/usr/local/php \
--enable-fpm \
--enable-inline-optimization \
--disable-magic-quotes \
--enable-mbstring \
--enable-mbregex \
--enable-safe-mode \
--enable-wddx=shared \
--enable-xml \
--with-gd \
--enable-gd-native-ttf \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-freetype-dir=/usr \
--with-gettext \
--with-curl \
--with-mysql=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-regex=system \
--with-zlib-dir=/usr/lib \
--with-openssl \
--with-snmp \
--enable-ucd-snmp-hack
这种情况仅发生在应用程序的某个页面上(代码太大而无法共享)。看来关机时失败了。大约 6 或 7 年前,我在 PHP 跟踪器上看到了这个错误报告,但从那以后就没听说过有人看到过它。
奇怪的是,几天前一切都工作正常,直到我对应用程序进行了一些更改。它并不是单一的,我希望我能够查明确切的提交,但是从它工作到下次我意识到它不工作之间大约有 5 次提交。
任何人都可以弄清楚这一点,还是我应该提交错误报告并希望得到最好的结果?
I'm getting an obnoxious segfault in PHP 5.3.6 (compiled from source, Slackware 13.1 x86, VPS in Linode). It is happening in both apache and nginx (fpm). Finally managed to get a core dump:
0 0x083db383 in _zval_ptr_dtor ()
1 0x083f3c45 in zend_hash_destroy ()
2 0x083e6fba in _zval_dtor_func ()
3 0x083da69a in _zval_dtor ()
4 0x083db3df in _zval_ptr_dtor ()
5 0x083f3c45 in zend_hash_destroy ()
6 0x083e6fba in _zval_dtor_func ()
7 0x083da69a in _zval_dtor ()
8 0x083db3df in _zval_ptr_dtor ()
9 0x083f3c45 in zend_hash_destroy ()
10 0x08406091 in zend_object_std_dtor ()
11 0x0840632e in zend_objects_free_object_storage ()
12 0x0840a44c in zend_objects_store_del_ref_by_handle_ex ()
13 0x0840a23b in zend_objects_store_del_ref ()
14 0x083e6fe1 in _zval_dtor_func ()
15 0x083da69a in _zval_dtor ()
16 0x083db3df in _zval_ptr_dtor ()
17 0x083f3c45 in zend_hash_destroy ()
18 0x08406091 in zend_object_std_dtor ()
19 0x0840632e in zend_objects_free_object_storage ()
20 0x0840a44c in zend_objects_store_del_ref_by_handle_ex ()
21 0x0840a23b in zend_objects_store_del_ref ()
22 0x083e6fe1 in _zval_dtor_func ()
23 0x083da69a in _zval_dtor ()
24 0x083db3df in _zval_ptr_dtor ()
25 0x083f3c45 in zend_hash_destroy ()
26 0x083e6fba in _zval_dtor_func ()
27 0x083da69a in _zval_dtor ()
28 0x083daed6 in shutdown_executor ()
29 0x083e86c8 in zend_deactivate ()
30 0x0838ebad in php_request_shutdown ()
31 0x084a3f26 in main ()
I'm using the memcache, apc, and mongo extensions (compiled from source). I tried disabling apc, but no luck. My PHP configure:
./configure \
--prefix=/usr/local/php \
--enable-fpm \
--enable-inline-optimization \
--disable-magic-quotes \
--enable-mbstring \
--enable-mbregex \
--enable-safe-mode \
--enable-wddx=shared \
--enable-xml \
--with-gd \
--enable-gd-native-ttf \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-freetype-dir=/usr \
--with-gettext \
--with-curl \
--with-mysql=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-regex=system \
--with-zlib-dir=/usr/lib \
--with-openssl \
--with-snmp \
--enable-ucd-snmp-hack
This happens only on one certain page of an application (code is too big to share). Looks like it's failing on shutdown. I saw this bug report on the PHP tracker from about 6 or 7 years ago, but haven't heard of anyone seeing it since.
What's weird is that everything was working fine a few days ago until I deployed some changes to the app. It was nothing monolithic, and I wish I could pinpoint the exact commit, but there were about 5 commits between when it worked and the next time I realized it wasn't working.
Can anyone make heads or tails of this, or should I submit a bug report and hope for the best?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
想通了(有点)。从 http://snaps.php.net/ 获取最新的开发版本 (5.3-201105190430) 并编译 & ;安装了它。这解决了问题(所以显然他们知道它并已将其排队等待包含)。
谢谢!
Figured it out (sort of). Got the latest dev build (5.3-201105190430) from http://snaps.php.net/ and compiled & installed it. That fixed the problem (so apparently they know about it and have it queued for inclusion).
Thanks!
我有一个客户正在经历几乎相同的核心转储。他们使用的是 PHP 5.2.17,因此这是一个长期存在的错误。感谢您指出该快照有效。我刚刚从 PHP 的 svn 中提取了截至该日期和时间的信息,并与现有的 5.3.6 进行了比较。我怀疑是其中之一修复了它:
。修复了错误 #54585(track_errors 导致段错误)。
。修复了错误 #54372(访问从 __get() 句柄返回的全局对象本身时发生崩溃)。
。修复了错误 #54262(为非数组中的维度赋值时崩溃)。
。修复了 dtor 内部错误处理崩溃的问题。
。修复了错误 #54580(通过 php_admin_value 设置 browscap ini 指令时 get_browser() 分段错误)。
你说这个问题出现在大约 5 次提交之间。您是否有机会向我提供仅包含这 5 个提交的应用程序的差异,以便我们可以准确地找出上述修复中的哪一个是相关的?它可能有助于确定解决该错误的方法。
请随时发送电子邮件至 releaze3 AT gmail DOT com。不是我的真实电子邮件,但我会从真实的电子邮件中回复(避免垃圾邮件 - 我不在乎垃圾邮件是否发送到该地址)。希望我们能够共同找出导致此问题的确切原因,并为无法升级 PHP 的人们提供解决方法。
I have a client who is experiencing an almost identical coredump. They are using PHP 5.2.17 so this is a long-standing bug. Thank you for pointing out that snapshot that worked. I just extracted from PHP's svn as of that date and time and did a diff versus the stock 5.3.6. I suspect it was one of these that fixed it:
. Fixed bug #54585 (track_errors causes segfault).
. Fixed bug #54372 (Crash accessing global object itself returned from its __get() handle).
. Fixed bug #54262 (Crash when assigning value to a dimension in a non-array).
. Fixed a crash inside dtor for error handling.
. Fixed bug #54580 (get_browser() segmentation fault when browscap ini directive is set through php_admin_value).
You said this problem appeared between about 5 commits. Is there any chance you can provide me with a diff of your app containing just those 5 commits so we can figure out exactly which of the above fixes is the relevant one? It may help to determine a way around the bug.
Please feel free to email releaze3 AT gmail DOT com. Not my real email but I will respond from my real one (avoiding spam - I dont care if spam goes to that address). Hopefully together we can work out exactly what causes this and give people a work-around who can't upgrade their PHP.
您可能会受到 https://bugs.php.net/bug.php?id= 的攻击63055“zend_gc 与 SF2 testsuite 中的段错误”显然是由“任何使用 zval_dtor 与递归数组都可能触发此段错误”引起的。
You might be hit by https://bugs.php.net/bug.php?id=63055 "Segfault in zend_gc with SF2 testsuite" which apparently is caused by "any usage of zval_dtor with recursive array may trigger this segfault."