dearblue · GitHub

In the following example, the fiber context and call stack may be in an incomplete state.
  - In case another thread running mruby is terminated abnormally
  - In case of a global jump that is out of management by mruby

@dearblue

@matz

dearblue added a commit to dearblue/mruby that referenced this pull request

Jun 6, 2024
Supplement to commit  177deba  (mruby#6276).
If the ci is incomplete, the previous method may cause the application to crash because `env->stack` points to an invalid address when expanding the data stack.
Since the ci is in an abnormal state, control it by putting `NULL` in `env->stack`.
If the ci is fine and top-level, detach `env` as usual with `mrb_env_unshare()`.

Merged

Read the original on github.com ↗