Commit 10807b5
Add io_close to TestScheduler.
In Ruby 4.1, IO#close without a scheduler io_close hook falls through to
maygvl_close with RB_NOGVL_OFFLOAD_SAFE, which calls
rb_fiber_scheduler_blocking_operation_wait. With a worker-pool scheduler
this causes a fiber switch, and GC compaction can then move the
blocking_operation VALUE — crashing in get_blocking_operation.
Fix: add io_close to TestScheduler delegating to @selector.io_close so
Ruby marks done=1 and skips maygvl_close entirely.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 218d53a commit 10807b5
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
0 commit comments