You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.
When attempting to upgrade to PHP 7.1 (and 7.2) I've been experiencing a consistent segfault with function runtime caches being null when calling certain methods in worker tasks (in our project the segfault is occurring when this function is called).
This issue did not occur on PHP 7.0 with the same pthreads source, leading me to believe a change to php-src is to blame for this bug.
Sadly I do not know how to reproduce this bug with minimal code, I've attempted to cut it down to a reproducing test case, but have been unable to produce one.
Both of the above commits resolve the issue in my project, however I'm a noob here.
Sorry for such a useless issue, I hope someone is better able to identify the cause of this problem than I am.
Visual Studio backtrace:
> php7ts.dll!ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(_zend_execute_data * execute_data) Line 28067 C
php7ts.dll!execute_ex(_zend_execute_data * ex) Line 59440 C
php7ts.dll!pthreads_execute_ex(_zend_execute_data * data) Line 150 C
php7ts.dll!ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER(_zend_execute_data * execute_data) Line 1071 C
php7ts.dll!execute_ex(_zend_execute_data * ex) Line 59440 C
php7ts.dll!pthreads_execute_ex(_zend_execute_data * data) Line 150 C
php7ts.dll!ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER(_zend_execute_data * execute_data) Line 889 C
php7ts.dll!execute_ex(_zend_execute_data * ex) Line 59440 C
php7ts.dll!pthreads_execute_ex(_zend_execute_data * data) Line 150 C
php7ts.dll!zend_call_function(_zend_fcall_info * fci, _zend_fcall_info_cache * fci_cache) Line 818 C
php7ts.dll!pthreads_routine_run_function(_pthreads_object_t * object, _pthreads_object_t * connection, _zval_struct * work) Line 481 C
php7ts.dll!pthreads_routine(_pthreads_routine_arg_t * routine) Line 516 C
pthreadVC2.dll!00007ff9524369b0() Unknown
[External Code]
The text was updated successfully, but these errors were encountered:
This call to function_add_ref() is responsible for the runtime cache destruction that triggers this bug. This 7.1 commit made the change which removes cache initialization from a hot path, on the assumption that cache is already initialized at that point.
The bug is triggered under the following approximate circumstances:
Worker is started without inheriting classes.
Class A extends AbstractClass extends Threaded is submitted. A inherits and uses some function from AbstractClass.
Class B extends AbstractClass extends Threaded is submitted. B inherits and uses some function from AbstractClass. This is when the fault occurs.
I still haven't been able to pin down an exact test case, but I'm closing in. I can reproduce it from within PM after removing the fix that closed this issue, but I haven't managed to cut it down to the finest parts yet.
As far as I can tell, the call to function_add_ref() here is entirely redundant in PHP 7.0+.
After removing this call, it becomes apparent that this code is redundant, because pthreads_copy_user_function() always destroys the cache of copied functions, which means there is no chance of sharing a runtime cache anyway.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Environment
Summary
When attempting to upgrade to PHP 7.1 (and 7.2) I've been experiencing a consistent segfault with function runtime caches being null when calling certain methods in worker tasks (in our project the segfault is occurring when this function is called).
This issue did not occur on PHP 7.0 with the same pthreads source, leading me to believe a change to php-src is to blame for this bug.
Sadly I do not know how to reproduce this bug with minimal code, I've attempted to cut it down to a reproducing test case, but have been unable to produce one.
Possible solutions
sirsnyder@fd8fac4
pmmp/ext-pmmpthread@56115b1
Both of the above commits resolve the issue in my project, however I'm a noob here.
Sorry for such a useless issue, I hope someone is better able to identify the cause of this problem than I am.
Visual Studio backtrace:
The text was updated successfully, but these errors were encountered: