JRuby latest master: jruby 184.108.40.206-SNAPSHOT (2.3.3) 2017-06-29 4bc6c50 Java HotSpot(TM) 64-Bit Server VM 25.131-b11 on 1.8.0_131-b11 [linux-x86_64] (Noticed that latest master still reports 220.127.116.11, but this is defnitely latest master)
Kernel: Linux maruchan 4.11.0-041100-generic #201705041534 SMP Thu May 4 19:36:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Distro: Ubuntu 17.04
As a followup of #4686, while I was trying to isolate the problem I also wrote the following rather-synthetic example:
This is fixed by marking all thread procs as escaped, similar to the other fix in #4686. The logic for marking the block escaped worked properly, but the proc duplicated the block and did not preserve its escape state.
Note that the new spec, now in JRuby seems to not pass:
bin/jruby spec/mspec/bin/mspec run -Gfails -Gcritical -Gslow /home/eregon/code/jruby/spec/ruby/language/break_spec.rb
$ /home/eregon/code/jruby/bin/jruby /home/eregon/code/jruby/spec/mspec/bin/mspec-run -Gfails -Gcritical -Gslow /home/eregon/code/jruby/spec/ruby/language/break_spec.rb
jruby 18.104.22.168-SNAPSHOT (2.3.3) 2017-07-27 8246886 OpenJDK 64-Bit Server VM 25.121-b14 on 1.8.0_121-b14 +jit [linux-x86_64]
[/ | 0% | 00:00:00] 0F 0E Exception in thread "Ruby-0-Thread-1: /home/eregon/code/jruby/spec/ruby/language/break_spec.rb:67" org.jruby.ir.runtime.IRBreakJump
The break statement in a captured block from another thread raises a LocalJumpError when getting the value from another thread FAILED
Expected LocalJumpError but no exception was raised (nil was returned)
/home/eregon/code/jruby/spec/ruby/language/break_spec.rb:73:in `block in (root)'
It looks like the exception is raised on the break and not on .value.
So here is 👍 to a good spec.