nqp
nqp copied to clipboard
try and die can cause infinite loop under some rare condition
The bug was discovered in Perl6::Metamodel::MethodContainer
role, add_method
method while resolving https://github.com/rakudo/rakudo/issues/2250. It turned out that the compiler is freezing due to infinite loop happening when nqp::die
throws and the try
block within it catches the exception (or whatever else happens internally) and passes the control back to the same die
.
Unfortunately, I haven't managed to golf the code down. But in my fork of rakudo repository I have a tag try_die_loop with two commented out lines. Those lines would clearly demonstrate the issue when uncommented. For unexplainable reason these two lines doesn't cause same effect if replicated at any other location up the call stack.
Platform: This is nqp version 2018.12-84-g6cf6e9a72 built on MoarVM version 2018.12-45-ga9d02578a)
Is this issue still occurring with a recent rakudo fork?