Raku / nqp

NQP
Other
345 stars 131 forks source link

try and die can cause infinite loop under some rare condition #519

Open vrurg opened 5 years ago

vrurg commented 5 years ago

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)

coke commented 2 years ago

Is this issue still occurring with a recent rakudo fork?