You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix out-of-bounds panic caused by use of undefined indices when the free queue storage is resized.
Before this change, the following sequence of events was possible:
1. The current free queue storage region (between head and tail) wraps around the end of the array
2. An entry is added via `didGetNewHandleNoResize`, which resizes the free queue backing slice
3. The region between head and tail now contains an undefined entry
I initially fixed this by always preferring to use entries from the free list, but the problem with that solution
is that a smaller number of indices are used, and their cycle counts are incremented more often, which
would increase the chances of a stale handle accidentally aliasing a re-used handle.
This new strategy is to prefer entries from the free list only if it spans past the end of the storage buffer,
and to prefer unused entries otherwise.
0 commit comments