mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
61f99385ba
Fix task termination crash caused by fiber_terminate freeing task context resources. When a task completes, the VM would call fiber_terminate which frees cibase/stbase, then next resume attempt crashes dereferencing NULL pointers. Solution unifies task and fiber lifecycle management: - Set vmexec flag before calling mrb_vm_exec to prevent fiber_terminate from being called during normal task completion - Save proc/pc to local variables to avoid CI_PROC_SET macro corruption - Add termination check in mrb_task_free to prevent double-free Tasks now follow the same execution pattern as Fiber, leveraging VM's built-in context management. Co-authored-by: Claude <noreply@anthropic.com>