|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-11-04 06:57 UTC] gopalv@php.net
[2012-11-04 14:46 UTC] miau dot jp at gmail dot com
[2012-11-04 16:05 UTC] laruence@php.net
[2012-12-12 08:08 UTC] ab@php.net
-Status: Open
+Status: Not a bug
[2012-12-12 08:08 UTC] ab@php.net
[2012-12-13 20:55 UTC] miau dot jp at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 07:00:01 2025 UTC |
Description: ------------ My project has many test cases and phpunit sometimes fails with segfault. ("exec returned: 139" on Jenkins console log) Here is some information from the core dump. Segfault was occured on releasing apc_globals.cache_stack.data[16]. ---- Core was generated by `/usr/bin/php /usr/bin/phpunit --debug'. Program terminated with signal 11, Segmentation fault. #0 0x00002b740ecb3213 in apc_deactivate () at /var/tmp/APC/apc_main.c:929 warning: Source file is more recent than executable. 929 for (i = 0; cache_entry->data.file.classes[i].class_entry != NULL; i++) { (gdb) bt #0 0x00002b740ecb3213 in apc_deactivate () at /var/tmp/APC/apc_main.c:929 #1 apc_request_shutdown () at /var/tmp/APC/apc_main.c:1042 #2 0x00002b740ecaa775 in zm_deactivate_apc (type=207817184, module_number=404473472) at /var/tmp/APC/php_apc.c:407 #3 0x00000000005c483c in ?? () #4 0x00000000005cf174 in zend_hash_reverse_apply () #5 0x00000000005c27bd in ?? () #6 0x000000000056f2b5 in php_request_shutdown () #7 0x000000000064b953 in ?? () #8 0x0000003b6f61d994 in __libc_start_main () from /lib64/libc.so.6 #9 0x0000000000422509 in _start () (gdb) p *apc_globals.cache_stack $37 = {data = 0x24a2be50, capacity = 160, size = 16} (gdb) p *(apc_cache_entry_t *) apc_globals.cache_stack.data[16] $59 = {data = {file = {filename = 0x0, op_array = 0x0, functions = 0x0, classes = 0x8, halt_offset = 0, exec_refcount = 0x0}, user = {info = 0x0, info_len = 0, val = 0x0, ttl = 8}}, type = 0 '\000', ref_count = 0, mem_size = 8, pool = 0x0} ---- From more investigation, apc_globals.cache_stack.data[16] was below before corrupted. (gdb) p *(apc_cache_entry_t *) apc_globals.cache_stack.data[16] $7 = {data = {file = {filename = 0x2adcae4e91d8 "/usr/share/pear/Zend/Validate/Hostname/Jp.php", op_array = 0x2adcae4c60a8, functions = 0x2adcae4e9158, classes = 0x2adcae4e9170, halt_offset = -1, exec_refcount = 0x21a0d350}, user = { info = 0x2adcae4e91d8 "/usr/share/pear/Zend/Validate/Hostname/Jp.php", info_len = -1370726232, val = 0x2adcae4e9158, ttl = 2924384624}}, Although this chache was pushed on apc_globals.cache_stack, long ( > apc.gc_ttl) running of script cause freeing this cache and the same address seems to be reused by another cache. Download the following gist and running segfault.php with "-d apc.gc_ttl=1 -d apc.shm_size=1M" option will reproduce the problem. (Tested on PHP 5.3.18 and APC 3.1.13) Test script: --------------- https://gist.github.com/4008149 Expected result: ---------------- # php -d apc.gc_ttl=1 -d apc.shm_size=1M segfault.php (no output) # echo $? 0 Actual result: -------------- # php -d apc.gc_ttl=1 -d apc.shm_size=1M segfault.php Segmentation fault # echo $? 139