[ruby-core:89657] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process

From: Eric Wong <normalperson@...>
Date: 2018-10-31 07:02:05 UTC
List: ruby-core #89657
> > Sorry, I missed your message about in_jit.  Trying ccan/list now
> > as r65468
> 
> Reverted r65468 for now because all MJIT CIs failed (sorry, was
> tired and needed to go afk for a bit)

Possible fix on top of r65468 (if unreverted) but I'm too tired to
wait for local tests to finish a few times right now...

```
diff --git a/mjit_worker.c b/mjit_worker.c
index 5008e6d8bc..b8ebb29812 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1041,6 +1041,13 @@ convert_unit_to_func(struct rb_mjit_unit *unit, struct rb_call_cache *cc_entries
     in_jit = TRUE;
     CRITICAL_SECTION_FINISH(3, "before mjit_compile to wait GC finish");
 
+    /* We need to check again here because we could've waited on GC above */
+    if (unit->iseq == NULL) {
+        if (!mjit_opts.save_temps)
+            remove_file(c_file);
+        free_unit(unit);
+        return (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC;
+    }
     {
         VALUE s = rb_iseq_path(unit->iseq);
         const char *label = RSTRING_PTR(unit->iseq->body->location.label);
```

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

In This Thread

Prev Next