nqp icon indicating copy to clipboard operation
nqp copied to clipboard

try and die can cause infinite loop under some rare condition

Open vrurg opened this issue 5 years ago • 1 comments

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)

vrurg avatar Feb 07 '19 03:02 vrurg

Is this issue still occurring with a recent rakudo fork?

coke avatar Apr 16 '22 22:04 coke