-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php-5.5.8 Segmentation fault xhprof.c #33
Conversation
call graph: changed color of arrows/edges to grey for better readability of the labels
fixes PR phacility#20 when using randomly generated run ids
Ignore build artifacts from Git
call graph: changed color of arrows/edges to grey for readability
php-5.5.8 Segmentation fault details: (gdb) f 0 #0 hp_execute_internal (execute_data=0x7fffffffa600, fci=0x7fffffffa780, ret=1) at /opt/xhprof/extension/xhprof.c:1708 1708 temp_variable *retvar = &EX_T(opline->result.var); (gdb) #0 hp_execute_internal (execute_data=0x7fffffffa600, fci=0x7fffffffa780, ret=1) at /opt/xhprof/extension/xhprof.c:1708 1708 temp_variable *retvar = &EX_T(opline->result.var); (gdb) print opline $1 = (zend_op *) 0x0
this patch working on my mac osx 10.8 with php55. |
I also have this segmentation fault, in exactly the same line 1708 I'm using PHP 5.5.3-1ubuntu2.1 from current Ubuntu 13.10 I would be nice if it could be merged and a new PECL package could be released. (gdb) bt |
We just applied this patch and built our xhprof package, this one is working well for us. Many thanks! |
I hit what is presumably the same issue (consistent segfault under PHP 5.5.8 on OS X); this also fixed it for me. |
@kovalenko can you sign the contributor agreement at https://code.facebook.com/cla |
Does anybody know how to contact @kovalenko, so that this PR gets unblocked? |
I've generated a similar patch here: https://secure.phabricator.com/D10374 These don't have a CLA issue and should land once they're reviewed. |
Summary: This adds a failing test case for the bug discussed in <#33>. It also adds a `bin/xhprofile` script which makes it easier to test stuff like this, by invoking the profiler on some other script. This isn't hugely useful in production but is valuable diagnostically, and helped me reduce this test case. Test Plan: - Ran `arc unit` and got a failure. - Verified that this test passes if `class_exists()` is commented out (which makes the test not segfault). Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D10374
Summary: Fixes <#33>. Since the issue with that patch was CLA, I developed this independently. This works because it just inlines the body of `execute_internal()`, which is nearly identical: ``` ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC) { if(fci != NULL) { ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); } else { zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr; ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr, (execute_data_ptr->function_state.function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)?return_value_ptr:NULL, execute_data_ptr->object, return_value_used TSRMLS_CC); } } ``` Test Plan: Failing test now passes. No more segfaults on PHP 5.5.8. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D10375
phacility#32 phacility#33 releasing
php-5.5.8 Segmentation fault
details:
(gdb) f 0
#0 hp_execute_internal (execute_data=0x7fffffffa600, fci=0x7fffffffa780, ret=1) at /opt/xhprof/extension/xhprof.c:1708
1708 temp_variable *retvar = &EX_T(opline->result.var);
(gdb) print opline
$1 = (zend_op *) 0x0