diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2019-06-20 13:41:18 +1200 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2019-06-20 13:41:18 +1200 |
commit | dbc2b89bc042d73e60aeb7d56686aa28d82e2622 (patch) | |
tree | 24df8e3faf9d37b9020c23ce21c2c769beb13920 /thread.c | |
parent | 6bf1285b2069ff736e283a1f8328852e3175fccc (diff) |
Ensure `vm_stack` is cleared after fork.
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -596,7 +596,11 @@ thread_cleanup_func_before_exec(void *th_ptr) { rb_thread_t *th = th_ptr; th->status = THREAD_KILLED; + // The thread stack doesn't exist in the forked process: th->ec->machine.stack_start = th->ec->machine.stack_end = NULL; + + // The vm_stack is `alloca`ed on the thread stack, so it's gone too: + rb_ec_clear_vm_stack(th->ec); } static void |