Commit 1ab6277
Fix GC safety in rb_fiber_scheduler_blocking_operation_wait
Extract the raw operation pointer before rb_funcall so it is obtained
while the GVL is held and no fiber switch has occurred yet.
Place RB_GC_GUARD(blocking_operation) after the last implicit use of the
VALUE — all accesses via the derived `operation` pointer — so the
compiler cannot treat blocking_operation as dead before this point,
keeping it reachable as a GC root through rb_funcall and through all
subsequent uses of the raw pointer.
See: socketry/io-event#172
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 56cd26f commit 1ab6277
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
1100 | 1101 | | |
1101 | 1102 | | |
1102 | 1103 | | |
1103 | | - | |
1104 | | - | |
1105 | 1104 | | |
1106 | 1105 | | |
1107 | 1106 | | |
| |||
1111 | 1110 | | |
1112 | 1111 | | |
1113 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
1114 | 1115 | | |
1115 | 1116 | | |
1116 | 1117 | | |
| |||
0 commit comments