-
Notifications
You must be signed in to change notification settings - Fork 576
Segfault when leaving smartmatch'ed sub #16608
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
Comments
From @dur-randirCreated by @dur-randirThis test case was originally found with afl and then I've expanded it 0 Perl Info
|
From @jkeenanOn Thu, 05 Jul 2018 03:50:41 GMT, randir wrote:
Confirmed with an unthreaded 5.28.0: ##### $ perl -e 'FOO: 0~~sub{goto FOO} for 0' $ perl -e '0~~sub{next} for 0' $ perl -e '0~~sub{last} for 0' Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From what I can tell dopoptoloop() or dopoptolabel() is unwinding the context and save stacks past where the call_sv() is done. We've added special handling for defer callbacks, but I can see this being a general problem for all call_sv()s when the called sub does a loop exit.
Class initialization can crash in a similar way:
Other call_sv()s in core all seem to use |
dopoptoloop() or dopoptolabel() would find a loop outside the sub called from call_sv() and rewind the context and save stack to outside the context set up by call_sv(), crashes and panics ensure. Switching stacks here also starts a new context stack, so the outer loop isn't found and we don't crash. Most other callers to call_sv() (or call_method() etc) do the same. I'm not entirely sure about passing flags = 1 to push_stackinfo(), this matches pp_sort, but not other callers. Fixes Perl#16608
Using last, next etc would pop the context stack to above the call_sv(), generally resulting in a crash or assertion failure. The search the context to pop to stops at the top of the current context stack, and PUSHSTACKi() switches to a new stack, preventing the search from finding any loop outside the call_sv() Similar to Perl#16608
Using last, next etc would pop the context stack to above the call_sv(), generally resulting in a crash or assertion failure. The search the context to pop to stops at the top of the current context stack, and PUSHSTACKi() switches to a new stack, preventing the search from finding any loop outside the call_sv() Similar to #16608
dopoptoloop() or dopoptolabel() would find a loop outside the sub called from call_sv() and rewind the context and save stack to outside the context set up by call_sv(), crashes and panics ensure. Switching stacks here also starts a new context stack, so the outer loop isn't found and we don't crash. Most other callers to call_sv() (or call_method() etc) do the same. I'm not entirely sure about passing flags = 1 to push_stackinfo(), this matches pp_sort, but not other callers. Fixes Perl#16608
Using last, next etc would pop the context stack to above the call_sv(), generally resulting in a crash or assertion failure. The search the context to pop to stops at the top of the current context stack, and PUSHSTACKi() switches to a new stack, preventing the search from finding any loop outside the call_sv() Similar to Perl#16608
dopoptoloop() or dopoptolabel() would find a loop outside the sub called from call_sv() and rewind the context and save stack to outside the context set up by call_sv(), crashes and panics ensure. Switching stacks here also starts a new context stack, so the outer loop isn't found and we don't crash. Most other callers to call_sv() (or call_method() etc) do the same. I'm not entirely sure about passing flags = 1 to push_stackinfo(), this matches pp_sort, but not other callers. Fixes Perl#16608
Using last, next etc would pop the context stack to above the call_sv(), generally resulting in a crash or assertion failure. The search the context to pop to stops at the top of the current context stack, and PUSHSTACKi() switches to a new stack, preventing the search from finding any loop outside the call_sv() Similar to Perl#16608
dopoptoloop() or dopoptolabel() would find a loop outside the sub called from call_sv() and rewind the context and save stack to outside the context set up by call_sv(), crashes and panics ensure. Switching stacks here also starts a new context stack, so the outer loop isn't found and we don't crash. Most other callers to call_sv() (or call_method() etc) do the same. I'm not entirely sure about passing flags = 1 to push_stackinfo(), this matches pp_sort, but not other callers. Fixes #16608
Using last, next etc would pop the context stack to above the call_sv(), generally resulting in a crash or assertion failure. The search the context to pop to stops at the top of the current context stack, and PUSHSTACKi() switches to a new stack, preventing the search from finding any loop outside the call_sv() Similar to #16608
Migrated from rt.perl.org#133330 (status was 'open')
Searchable as RT133330$
The text was updated successfully, but these errors were encountered: