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
Control exception handling is inconsistent and broken across backends. (SEGV on moar, CX unrecognized on jvm) #4688
Comments
From @peschwaR-J currently fails in about five files in roast with "control exception without handler", golfable as follows: 16:08 <psch> r: A: for 1 { for 1 { last A } }; Digging around a bit showed that in this specific case the exception is of type 4104, e.g. last_labeled, which clearly is correct. The case of last-ing out of the current loop (with or without label) works, as follows: 16:12 <psch> j: A: for 1 { last A }; for 1 { last } Installing a CONTROL block in the labeled loop in the first case works somewhat as expected, the exception is caught, but doesn't identify itself as CX::Last: 16:15 <psch> j: A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } } The same code on R-M segfaults: 16:15 <psch> m: A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } } I have looked at the R-J and NQP-J CX handling, and have the suspicion that responsibility partly lies with org.perl6.nqp.runtime.ExceptionHandling:90, where it's decided not to use a handler if it's from the current frame. The corresponding code in Moar is beyond my C-understanding, but I further suspect that either the condition for discarding a possibly valid handler is different, or that codegen on moar inserts handlers differently. Also of note might be that neither NQP implements labeled loops themselves, even though it's from NQP::Grammar and NQP::Actions that we get handling of last/next/redo in the first place. |
From @nwc10On Thu, Oct 29, 2015 at 09:22:30AM -0700, Pepe Schwarz wrote:
$ ./perl6-m -Ilib -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }'
|
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Thu, Oct 29, 2015 at 07:41:06PM +0000, Nicholas Clark wrote:
valgrind concurs: $ valgrind /home/nicholas/Sandpit/moar-g/bin/moar --libpath="/home/nicholas/Sandpit/moar-g/share/nqp/lib" --libpath="." /home/nicholas/Perl/rakudo/perl6.moarvm -Ilib -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }' Nicholas Clark |
From @usev6As a status update: This code no longer segfaults on Moar: $ perl6-m -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }' |
1 similar comment
From @usev6As a status update: This code no longer segfaults on Moar: $ perl6-m -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }' |
From @usev6I unfudged one test for this ticket in S04-statements/label.t with commit Raku/roast@ef7b0da83d The code that used to segfault works fine now: $ perl6-m -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }' $ perl6-j -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }' The mentioned failing tests for rakudo-j are still a thing, tough. |
1 similar comment
From @usev6I unfudged one test for this ticket in S04-statements/label.t with commit Raku/roast@ef7b0da83d The code that used to segfault works fine now: $ perl6-m -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }' $ perl6-j -e 'A: for 1 { for 1 { last A }; CONTROL { when CX::Last { say "last" }; default { .perl.say } } }' The mentioned failing tests for rakudo-j are still a thing, tough. |
From @usev6On Sat, 16 Jul 2016 13:18:42 -0700, bartolin@gmx.de wrote:
The remaining tests fudged with this ticket are passing with rakudo-j now. I unfudged them with commit Raku/roast@07517a0006 |
From @dogbert17On Mon, 16 Oct 2017 13:04:48 -0700, bartolin@gmx.de wrote:
Fixed with commit rakudo/rakudo@1fbb8b4 |
From @AlexDanielSegfault mentioned above is already tested and the test was unfudged in Closing
|
@AlexDaniel - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#126490 (status was 'resolved')
Searchable as RT126490$
The text was updated successfully, but these errors were encountered: