Issue #14867 has been updated by k0kubun (Takashi Kokubun).


> I'm testing this patch for ccan/list in rb_mjit_unit:
> https://80x24.org/spew/20181030030441.10036-1-e / 80x24.org/raw

It's okay to merge it. Migration to ccan/list was one of things I wanted to do later. Though, as said above, I'll resurrect compact_units to clean up them on ruby_cleanup anyway after you commit that.

> Howeever, I think I found an old bug. Accessing unit->iseq->body outside of critical section seems wrong and I hit a segfault:

Accessing iseq->body in the part you quote was completely intentional. Prior to leaving the critical section before mjit_compile, it waits for the current GC finish and set `in_jit`. With `in_jit` set to TRUE, other Ruby threads may not start GC due to `mjit_gc_start_hook`. Even while we're running tests with --jit for 24 hours on ko1's CI, I don't remember SEGV on that line. 

If the SEGV is reproductive on trunk without your patch, please let me know so that I can start looking at it.

----------------------------------------
Bug #14867: Process.wait can wait for MJIT compiler process
https://bugs.ruby-lang.org/issues/14867#change-74674

* Author: k0kubun (Takashi Kokubun)
* Status: Assigned
* Priority: Normal
* Assignee: normalperson (Eric Wong)
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
If Ruby tries to wait for any child process, MJIT's gcc/clang process could be caught by the method call. It's not convenient for both Ruby's user and MJIT worker thread, so Process.wait and its families should somehow avoid waiting for it.

---Files--------------------------------
0001-hijack-SIGCHLD-handler-for-internal-use.patch (13.8 KB)
JIT-test-all.log (39.9 KB)
mjit_test-all_63796.log (40.4 KB)
config_ruby-loco_mingw.log (27 KB)
test_jit_results.txt (41.2 KB)
14867_91_mingw_build_log_.txt (127 KB)


-- 
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>