|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49922 destroy_op_array refcount invalid ptr / apache filter sapi
Submitted: 2009-10-19 16:12 UTC Modified: 2009-11-30 10:18 UTC
From: m dot moeller at bigpoint dot net Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.2.11 OS: *
Private report: No CVE-ID: None
 [2009-10-19 16:12 UTC] m dot moeller at bigpoint dot net
if apache receives a shutdown signal, php occasionally triggers a segfault.

#2  0x00007f5c4ea35268 in destroy_op_array (op_array=0x1670790) at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c:230
#3  0x00007f5c4ea49488 in zend_hash_destroy (ht=0x14b8910) at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_hash.c:717
#4  0x00007f5c4ea3eb3a in zend_shutdown () at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend.c:816
#5  0x00007f5c4e9f8975 in php_module_shutdown () at /tmp/buildd/php5-5.2.6.dfsg.1/main/main.c:1908
#6  0x00007f5c4e9f8a19 in php_module_shutdown_wrapper (sapi_globals=0x0) at /tmp/buildd/php5-5.2.6.dfsg.1/main/main.c:1879
#7  0x00007f5c4eab2a21 in php_apache_child_shutdown (tmp=0x0) at /tmp/buildd/php5-5.2.6.dfsg.1/sapi/apache2handler/sapi_apache2.c:362
#8  0x00007f5c55e31a5c in ?? () from /usr/lib/
#9  0x00007f5c55e30ca3 in apr_pool_destroy () from /usr/lib/
#10 0x000000000044d8de in clean_child_exit (code=0) at /build/buildd-apache2_2.2.9-10+lenny4-amd64-wTiRUQ/apache2-2.2.9/server/mpm/prefork/prefork.c:198
#11 0x000000000044e00b in just_die (sig=<value optimized out>) at /build/buildd-apache2_2.2.9-10+lenny4-amd64-wTiRUQ/apache2-2.2.9/server/mpm/prefork/prefork.c:330
#12 <signal handler called>

#2  0x00007f5c4ea35268 in destroy_op_array (op_array=0x1670790) at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c:230
230     /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c: No such file or directory.
        in /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c
(gdb) print op_array->refcount
$1 = (zend_uint *) 0x7f5c4cbdb908
(gdb) print *op_array->refcount
Cannot access memory at address 0x7f5c4cbdb908

Reproduce code:
while true; do
  curl http://localhost/testpage.php &
  apachectl restart

Expected result:
clear error log

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-19 16:50 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

 [2009-11-30 10:18 UTC] m dot moeller at bigpoint dot net
same error with php version 5.2.11
 [2011-09-02 10:38 UTC] rojaro at gmail dot com
This bug is still present (5.3.8) ... :(
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon May 23 09:05:45 2022 UTC