diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-27 23:05:56 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-27 23:06:29 -0800 |
commit | 1d1200555faa22683b7d2436f77c00f55044bba1 (patch) | |
tree | 72c720db7802b578bc41f292fb8f4869db98f2de /mjit.c | |
parent | 168b0e1f025a3c8927bbf548cc4631862fe22d29 (diff) |
MJIT: Avoid hanging on mjit_wait with a JIT failure
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1387,8 +1387,13 @@ static void mjit_wait(struct rb_iseq_constant_body *body) { pid_t initial_pid = current_cc_pid; - struct timeval tv; + if (initial_pid == 0) { + mjit_warning("initial_pid was 0 on mjit_wait"); + return; + } + int tries = 0; + struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 1000; while (body == NULL ? current_cc_pid == initial_pid : body->jit_func == (jit_func_t)NOT_READY_JIT_ISEQ_FUNC) { // TODO: refactor this |