Commit a49967b
committed
fix(driver): bounds-check buffer_id in Shared::reset
BufferPoolRoot::release() drains inner.bufs via mem::take, but the
Shared Rc may still be alive. When a BufferRef is dropped after
release, its Drop impl upgrades the Weak successfully and calls
Shared::reset with a stale buffer_id, panicking on the unchecked
index into the now-empty Vec.
Use get_mut (matching the existing bounds check in Shared::take)
and deallocate the buffer directly when the slot no longer exists.
Reproduces under macOS kqueue when closing sockets under
backpressure (PUSH saturating a PULL with low HWM).1 parent 2e1a8f6 commit a49967b
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
356 | 360 | | |
357 | 361 | | |
358 | 362 | | |
| |||
0 commit comments