Issue #15071 has been reported by wanabe (_ wanabe).

----------------------------------------
Bug #15071: RubyVM::MJIT.pause may cause deadlock after compaction
https://bugs.ruby-lang.org/issues/15071

* Author: wanabe (_ wanabe)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Sometimes I met thread-deadlock while waiting `RubyVM::MJIT.pause`.
Here is a terminal log.

```
$ ruby --disable-gems --jit --jit-verbose=1 --jit-max-cache=3 -e '100.times do |i| eval("def foo#{i}; end; " + "foo#{i}; " * 5); end; RubyVM::MJIT.pause'
JIT success (96.7ms): block in <main>@-e:1 -> /tmp/_ruby_mjit_p9628u4.c
JIT success (25.0ms): foo0@(eval):1 -> /tmp/_ruby_mjit_p9628u0.c
JIT success (26.2ms): foo1@(eval):1 -> /tmp/_ruby_mjit_p9628u1.c
JIT success (24.4ms): foo2@(eval):1 -> /tmp/_ruby_mjit_p9628u2.c
JIT success (28.0ms): foo3@(eval):1 -> /tmp/_ruby_mjit_p9628u3.c
JIT success (24.8ms): foo4@(eval):1 -> /tmp/_ruby_mjit_p9628u5.c
JIT success (25.4ms): foo5@(eval):1 -> /tmp/_ruby_mjit_p9628u6.c
JIT success (24.5ms): foo6@(eval):1 -> /tmp/_ruby_mjit_p9628u7.c
JIT success (25.1ms): foo7@(eval):1 -> /tmp/_ruby_mjit_p9628u8.c
JIT success (25.7ms): foo8@(eval):1 -> /tmp/_ruby_mjit_p9628u9.c
JIT compaction (4.9ms): Compacted 10 methods -> /tmp/_ruby_mjit_p9628u101.so
JIT success (23.9ms): foo9@(eval):1 -> /tmp/_ruby_mjit_p9628u10.c
^CTraceback (most recent call last):
	1: from -e:1:in `<main>'
-e:1:in `pause': Interrupt
JIT success (62.2ms): foo10@(eval):1 -> /tmp/_ruby_mjit_p9628u11.c
Successful MJIT finish

```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>