You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upstream the mruby stack_init() nil-init fix (multi-VM-per-process crash) #60
PR #59 fixed a latent upstream mruby bug (present through mruby 3.4.0): stack_init() in vendor/mruby/src/vm.c mallocs the initial 128-slot VM stack but never nil-initializes it, unlike stack_extend_alloc() which stack_clear()s its grown region. GC's mark_context_stack() then reads uninitialized slots — harmless on a first boot (fresh zero mmap) but on a later mrb_open (after prior VMs dirtied the heap), a leftover word is marked as a bogus object pointer and dereferenced → SEGV. Linux-only (glibc/musl recycle dirty memory eagerly; macOS libmalloc masked it). Valgrind-confirmed dirty-memory-reuse, not OOB.
Our fix (one line, stack_clear(c->stbase, STACK_INIT_SIZE) in stack_init) is a local vendored patch documented in vendor/mruby/README.md as re-apply-on-bump. It should be reported/PR'd upstream to mruby — it affects anyone embedding multiple VMs per process. Task: file the upstream mruby issue + PR, link here; once upstream merges + we bump past it, drop the local patch.
Activity