dearblue · GitHub

If the filename and line number cannot be obtained, "(unknown):1" is used instead.
Also, the file name information of the terminated fiber cannot be retrieved and will be replaced as well.
This limitation is due to the fact that `cibase->proc` of the terminated fiber is collected by the GC.
```console
% bin/mruby -e 'p Fiber.new { p Fiber.current }.resume'
#<Fiber:0x82423bef0 -e:1 (resumed)>
#<Fiber:0x82423bef0 (unknown):1 (terminated)>
```

@dearblue

@matz

matz added a commit that referenced this pull request

Dec 8, 2023

matz added a commit that referenced this pull request

Dec 8, 2023

matz added a commit that referenced this pull request

Dec 8, 2023
…6105
Since `cxt->ci` points to the last active callinfo, `cxt->ci == cxt->cibase`
does not mean it does not have correct `proc` information, so we have
removed the `f->cxt->ci > f->cxt->cibase` check. Instead, just in case
`proc` does not have `irep` information, we try to confirm `proc` does not
point to `CFUNC` nor is not an alias.

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

Dec 9, 2023
When fiber is terminated, the pointer indicated by f->cxt->cibase->proc is not protected from GC.
I should have done this patch way as of commit  ca9e8d9  (mruby#6105).

Merged

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

Dec 9, 2023
When fiber is terminated, the pointer indicated by `f->cxt->cibase->proc` is not protected from GC.
I should have done this patch way as of commit  9af6264  (mruby#6105).

matz added a commit that referenced this pull request

Dec 15, 2023
Since Fiber#to_s did not include location information before #6105,
when location information cannot be retrieved for terminated fibers,
instead of meaningless information such as "(unknown):0", we omit
positional information altogether for terminated fibers; ref #6111

@dearblue

Read the original on github.com ↗