php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57332 APC SIGSEGV
Submitted: 2006-10-30 05:06 UTC Modified: 2007-02-25 03:42 UTC
From: rr at mima dot x dot se Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5.2.0 RC4 OS: HP-UX 11.11i
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: rr at mima dot x dot se
New email:
PHP Version: OS:

 

 [2006-10-30 05:06 UTC] rr at mima dot x dot se
Description:
------------
APC crashed when running a certain php page.
All other pages executed fine at the time.

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 28 (system thread 39032)]
0xc2d2be20 in prevent_garbage_collection (entry=0xc5d51858) at /var/tmp/APC-3.0.12p2/apc_cache.c:245
245             entry->data.file.op_array->refcount[0] = BIG_VALUE;
(gdb) bt
#0  0xc2d2be20 in prevent_garbage_collection (entry=0xc5d51858) at /var/tmp/APC-3.0.12p2/apc_cache.c:245
#1  0xc2d2d698 in apc_cache_find (cache=0x4035d330, key=Error accessing memory address 0x800: Bad address.
) at /var/tmp/APC-3.0.12p2/apc_cache.c:564
#2  0xc2d33d3c in my_compile_file (h=0x67bd5160, type=2, tsrm_ls=0x4062bc68)
    at /var/tmp/APC-3.0.12p2/apc_main.c:328
#3  0xc58adf34 in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER (execute_data=0x67bd4c88, tsrm_ls=0x4062bc68)
    at /var/tmp/php5.2-200610041230/Zend/zend_vm_execute.h:1987
#4  0xc58a03bc in execute (op_array=0x406da420, tsrm_ls=0x4062bc68)
    at /var/tmp/php5.2-200610041230/Zend/zend_vm_execute.h:92
#5  0xc5874c44 in zend_execute_scripts (type=8, tsrm_ls=0x4062bc68, retval=0x0, file_count=3)
    at /var/tmp/php5.2-200610041230/Zend/zend.c:1096
#6  0xc58181d4 in php_execute_script (primary_file=0x67bd3428, tsrm_ls=0x4062bc68)
    at /var/tmp/php5.2-200610041230/main/main.c:1758
#7  0xc591f2ac in php_handler (r=0x4042fac0)
    at /var/tmp/php5.2-200610041230/sapi/apache2handler/sapi_apache2.c:592
#8  0x000456ac in my_xml_leave ()
#9  0x00046138 in ap_invoke_handler ()
#10 0x0003dd20 in ap_process_request ()
#11 0x0003712c in ap_process_http_connection ()
#12 0x000530cc in ap_run_process_connection ()
#13 0x0005364c in ap_process_connection ()
#14 0x0003f7c4 in process_socket ()
#15 0x0004058c in my_instr_bin ()
#16 0xc22afb84 in dummy_worker () from /opt/hpws/apache/lib/libapr-0.sl.9
#17 0xc004b2e4 in __pthread_body () from /usr/lib/libpthread.1
(gdb) print entry
$1 = (apc_cache_entry_t *) 0xc5d51858
(gdb) print *entry
$2 = {data = {file = {filename = 0xc5d51880 "/usr/local/cacti-0.8.6i/lib/rrd.php", op_array = 0xc5d9fbe8, 
      functions = 0xc5da04d8, classes = 0xc5d51838}, user = {
      info = 0xc5d51880 "/usr/local/cacti-0.8.6i/lib/rrd.php", info_len = -975569944, val = 0xc5da04d8, 
      ttl = 3319076920}}, type = 1 '\001', autofiltered = 0 '\0', ref_count = 93, mem_size = 331153}
(gdb) print entry->data.file.op_array
$3 = (zend_op_array *) 0xc5d9fbe8
(gdb) print *entry->data.file.op_array
$4 = {type = 0 '\0', function_name = 0x1c5 <Error reading address 0x1c5: Bad address>, scope = 0x2b000000, 
  fn_flags = 0, prototype = 0x67ef145a, num_args = 0, required_num_args = 4, arg_info = 0x0, 
  pass_rest_by_reference = 0 '\0', return_reference = 0 '\0', refcount = 0x0, opcodes = 0x0, last = 0, size = 16, 
  vars = 0x3, last_var = 0, size_var = 0, T = 1, brk_cont_array = 0x600bf68, last_brk_cont = 1, 
  current_brk_cont = 3, try_catch_array = 0xc5dabfb8, last_try_catch = 15, static_variables = 0x2, 
  start_op = 0x601bf68, backpatch_count = 0, done_pass_two = 0 '\0', uses_this = 0 '\0', 
  filename = 0x51000000 <Error reading address 0x51000000: Bad address>, line_start = 0, line_end = 1743717090, 
  doc_comment = 0x0, doc_comment_len = 2, reserved = {0x0, 0x16f8, 0x0, 0x0}}

Reproduce code:
---------------
Unable to reproduce. I had APC in a state where it would crash repeatedly when executing a certain php file.
After removing the apc extension, restarting apache to confirm it was a APC bug and enabling APC again the problem went away.


Actual result:
--------------
SIGSEGV

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-30 10:07 UTC] gopalv82 at yahoo dot com
Have you by any chance built this with a -O3 CFLAGS ?
 [2006-10-31 05:38 UTC] rr at mima dot x dot se
-O2 with gcc 4.1.1 on PA-RISC
 [2006-10-31 06:21 UTC] gopalv82 at yahoo dot com
If you still have the core, could you please tell me what else was in the entry (i.e functions).
 [2007-02-25 03:42 UTC] rasmus@php.net
Try 3.0.13
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 22:01:31 2024 UTC