php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58431 Segfault when APC active
Submitted: 2008-11-25 11:24 UTC Modified: 2009-04-05 23:28 UTC
From: webmaster at ajeux dot com Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5_3 CVS-2008-11-25 (dev) OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: webmaster at ajeux dot com
New email:
PHP Version: OS:

 

 [2008-11-25 11:24 UTC] webmaster at ajeux dot com
Description:
------------
APC makes PHP segfault at every execution that require the opcode cache.
- First page printed is OK (when opcode must be generated).
- Same page refreshed is making a segfault.

I also tested with APC from CVS, but same problem.

Reproduce code:
---------------
This bug can be reproduced by pressing F5 several times: First print = OK, second = segfault. Third = OK, fourth = segfault. Etc.


<?php
error_reporting(E_ALL);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);

define('CWD', realpath(dirname(__FILE__).'/../').'/');

set_include_path ( '/usr/share/pear' . PATH_SEPARATOR . 'library' . PATH_SEPARATOR . CWD.'application/models'); //get_include_path()

require_once "Zend/Loader.php"; //Yes, this is Zend Framework
Zend_Loader::registerAutoload();

Zend_Loader::loadFile("Smarty/Smarty.class.php");

echo "Hello World";
?>

Additional informations: 
- bug only happened when set_include_path has at least 3 paths whith CWD as prefix.
- bug only happened when ini_set functions are present.
I wasn't able to reproduce the bug by removing anything else.
There is no segfault when "extension=apc.so" is removed in php.ini





Expected result:
----------------
"Hello World"

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.

zend_hash_destroy (ht=0xb7cacb08) at /usr/src/php5.3-snap/Zend/zend_hash.c:524
524                     p = p->pListNext;

#0  zend_hash_destroy (ht=0xb7cacb08) at /usr/src/php5.3-snap/Zend/zend_hash.c:524
#1  0x082519a1 in _zval_dtor_func (zvalue=0xb7cad320) at /usr/src/php5.3-snap/Zend/zend_variables.c:43
#2  0x08244a5a in _zval_ptr_dtor (zval_ptr=0xb7cad310) at /usr/src/php5.3-snap/Zend/zend_variables.h:35
#3  0x0825e313 in zend_hash_clean (ht=0xb7cac43c) at /usr/src/php5.3-snap/Zend/zend_hash.c:552
#4  0xb7a96a31 in apc_free_class_entry_after_execution (src=0xb7cac3f8) at /usr/src/APC-3.0.19/apc_compile.c:2320
#5  0xb7a99ff2 in apc_request_shutdown () at /usr/src/APC-3.0.19/apc_main.c:642
#6  0xb7a92862 in zm_deactivate_apc (type=1, module_number=25) at /usr/src/APC-3.0.19/php_apc.c:312
#7  0x08253bf0 in module_registry_cleanup (module=0x1d) at /usr/src/php5.3-snap/Zend/zend_API.c:2125
#8  0x0825df8d in zend_hash_apply (ht=0x85638e0, apply_func=0x8253bd0 <module_registry_cleanup>) at /usr/src/php5.3-snap/Zend/zend_hash.c:673
#9  0x08251f5f in zend_deactivate_modules () at /usr/src/php5.3-snap/Zend/zend.c:875
#10 0x081fa065 in php_request_shutdown (dummy=0x0) at /usr/src/php5.3-snap/main/main.c:1496
#11 0x082e9710 in main (argc=1, argv=0xbffed6c4) at /usr/src/php5.3-snap/sapi/cgi/cgi_main.c:2056



Full Backtrace :
----------------
#0  zend_hash_destroy (ht=0xb7cacb08) at /usr/src/php5.3-snap/Zend/zend_hash.c:524
        p = (Bucket *) 0x3
#1  0x082519a1 in _zval_dtor_func (zvalue=0xb7cad320) at /usr/src/php5.3-snap/Zend/zend_variables.c:43
No locals.
#2  0x08244a5a in _zval_ptr_dtor (zval_ptr=0xb7cad310) at /usr/src/php5.3-snap/Zend/zend_variables.h:35
No locals.
#3  0x0825e313 in zend_hash_clean (ht=0xb7cac43c) at /usr/src/php5.3-snap/Zend/zend_hash.c:552
        p = (Bucket *) 0xb7cad394


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-19 10:13 UTC] burnwave at gmail dot com
I am also getting segfaults on PHP 5.3 alpha3 with similar 
source as above.
 [2009-02-28 18:47 UTC] shire@php.net
I'm not able to replicate this problem with the latest PHP-5.3 CVS and the latest APC CVS.  Can you re-test to see if the problem is still present?  Thanks.
 [2009-04-05 23:28 UTC] shire@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC