Re: Re: APC-3.0.10 issue
| From: | James M. Luedke | Date: | Tue, 23 May 2006 22:58:06 +0000 |
| Subject: | Re: Re: APC-3.0.10 issue | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-3804@lists.php.net to get a copy of this message | ||
Sara Golemon wrote:
that comes with the library to connect to the running php daemon. In fact other than a few environment variable php never touches our webserver. This setup has worked for several months with the same php-4.3.11 source tree, and APC 3.0.8...Just to remove our application from the problem I am re-producing the issue with a simple test script.Okay, well, the opcodes I'm generating on this side match what the gdb results your producing in every way that matters so whether it's a cache miss and APC is recompiling the script or it's a cache hit and it's pulling it out of shared memory, all signs point to "it should just work". So rather than pound my head into the desk any longer, I'm going to try taking a wild shot in the dark. The backtrace seems to be pretty adamant about there being a write violation when trying to copy that constant value into the result node so that says to me that the storage space for that result value is unusable for some reason. The one thing quirky about this storage space is that it's on the stack and there *could* be a celestial misalignment between fastcgi, apc, and your webserver when it comes to allocating dynamic chunks of memory on the stack. What I'd like you to do is rebuild your PHP install with that feature disabled: If you would like to test this we just used a glorified version of cgi-fcgi
1. cd /path/to/phpsrc/ 2. edit Zend/zend_execute.c changing the following line (should be at or around line 56): #define TEMP_VAR_STACK_LIMIT 2000 to a value of zero #define TEMP_VAR_STACK_LIMIT 0 3. make all install Well, i rebuild with the requested change. I am not sure exactly whatI should be looking for. I still get the same SIGSEGV
Functionally, this core won't be any different from the one you've got now, but it'll allocate those temp vars on the heap rather than the stack. I admit I'm reaching here, but since I can't get this issue to reproduce locally I'm gonna have to poke the black box until something falls out... By the way, do you have apc.optimization turned on? If so, try turning it off and see if that makes a difference... (again, grasping at straws) Nope APC.optimization is not enabledalso built with ./configure --enable-apc I pasted more gdb output to the end of the message. Thanks again for all your help... -James
-Sara gdb outputProgram received signal SIGSEGV, Segmentation fault. execute (op_array=0x7b6120) at php-4.3.11-fastcgi/Zend/zend_execute.c:503
503 *variable_ptr = *value;(gdb) p execute_data.opline->op1.u.constant $1 = {value = {lval = 22, dval = 4.6683907401235991e-313, str = {
val = 0x16 <Address 0x16 out of bounds>, len = 0}, ht = 0x16, obj = {ce = 0x16,
properties = 0x0}}, type = 0 '\0', is_ref = 0 '\0', refcount = 0}
(gdb) p execute_data.opline->op1
$2 = {op_type = 4, u = {constant = {value = {lval = 22,
dval = 4.6683907401235991e-313, str = {
val = 0x16 <Address 0x16 out of bounds>, len = 0}, ht = 0x16, obj = {
ce = 0x16, properties = 0x0}}, type = 0 '\0', is_ref = 0 '\0',
refcount = 0}, var = 22, opline_num = 22, fetch_type = 22, op_array = 0x16,
EA = {var = 22, type = 0}}}
(gdb) p execute_data.opline->result.u.var
$3 = 23
(gdb) p *execute_data.opline
$4 = {opcode = 38 '&', result = {op_type = 4, u = {constant = {value = {lval = 23,
dval = 4.8805903192695329e-313, str = {
val = 0x17 <Address 0x17 out of bounds>, len = 1}, ht = 0x17, obj = {
ce = 0x17, properties = 0x1}}, type = 0 '\0', is_ref = 0 '\0',
refcount = 0}, var = 23, opline_num = 23, fetch_type = 23, op_array = 0x17,
EA = {var = 23, type = 1}}}, op1 = {op_type = 4, u = {constant = {value = {
lval = 22, dval = 4.6683907401235991e-313, str = {
val = 0x16 <Address 0x16 out of bounds>, len = 0}, ht = 0x16, obj = {
ce = 0x16, properties = 0x0}}, type = 0 '\0', is_ref = 0 '\0',
refcount = 0}, var = 22, opline_num = 22, fetch_type = 22, op_array = 0x16,
EA = {var = 22, type = 0}}}, op2 = {op_type = 1, u = {constant = {value = {
lval = 0, dval = 4.9406564584124654e-324, str = {val = 0x0, len = 1},
ht = 0x0, obj = {ce = 0x0, properties = 0x1}}, type = 1 '\001',
is_ref = 1 '\001', refcount = 2}, var = 0, opline_num = 0, fetch_type = 0,
op_array = 0x0, EA = {var = 0, type = 1}}}, extended_value = 0, lineno = 19}
(gdb) p execute_data
$5 = {opline = 0xf3002db4, function_state = {function_symbol_table = 0xff13a000,
function = 0x7b6120, reserved = {0x80000001, 0xffbef110, 0x1b0754, 0x12}},
fbc = 0x0, ce = 0x0, object = {ptr = 0x0}, Ts = 0x7adb48,
original_in_execution = 0 '\0', op_array = 0x7b6120, prev_execute_data = 0x0}
(gdb) p op_array->T
$6 = 49
(gdb) p *op_array
$7 = {type = 2 '\002', arg_types = 0x0, function_name = 0x0, refcount = 0xf3002354,
opcodes = 0xf3002364, last = 77, size = 77, T = 49, brk_cont_array = 0xf30041e4,
last_brk_cont = 1, current_brk_cont = 4294967295, uses_globals = 0 '\0',
static_variables = 0x0, start_op = 0x0, backpatch_count = 0,
return_reference = 0 '\0', done_pass_two = 1 '\001',
filename = 0xf300231c "/html/apcinfo.cgi", reserved = {
0x0, 0x1, 0x0, 0x7a4ef8}}
(gdb) bt
#0 execute (op_array=0x7b6120)
at php-4.3.11-fastcgi/Zend/zend_execute.c:503
#1 0x001b0784 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at php-4.3.11-fastcgi/Zend/zend.c:926
#2 0x001850cc in php_execute_script (primary_file=0xffbef8a8)
at php-4.3.11-fastcgi/main/main.c:1745
#3 0x001d1894 in main (argc=5, argv=0xffbef934)
at php-4.3.11-fastcgi/sapi/cgi/cgi_main.c:1698