Fix mixed-prefix drain in reuse_storage_immediate - #475
Open
lightsighter wants to merge 1 commit into
Open
Conversation
The oldest-entry drain loop applied the offsets-flavor PendingRelease::release() to every entry it drained, but the allocated/offsets outputs are only meaningful for old_inst's own redistrict entry. A ready follower swept up by the drain misbehaved: - a plain destroy (empty redistrict_tags) trips the assert(!redistrict_tags.empty()) in debug builds; in release builds split_range returns 0 and clobbers 'allocated', mis-notifying old_inst's already-placed children as ALLOC_EVENTUAL_FAILURE while their tags stay live in current_allocator (leaked ranges) - a redistrict follower with more children than old_inst overflows the offsets vector inside split_range (out-of-bounds write) Apply the offsets-flavor release only to old_inst's own entry and drain followers with the void flavor, matching the equivalent drain in release_storage_immediate. Adds two DeferredAllocBadPathTest units covering both follower shapes; on the unfixed code they reproduce the two assertion failures exactly. Adjudicated as BUG-7 in tla/allocation/bugs/BUG-7.md (checked in separately with the deferred-allocation verification campaign). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #475 +/- ##
==========================================
+ Coverage 30.41% 30.54% +0.13%
==========================================
Files 199 199
Lines 41282 41322 +40
Branches 14779 14776 -3
==========================================
+ Hits 12554 12621 +67
+ Misses 27488 27373 -115
- Partials 1240 1328 +88 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The oldest-entry drain loop applied the offsets-flavor PendingRelease::release() to every entry it drained, but the allocated/offsets outputs are only meaningful for old_inst's own redistrict entry. A ready follower swept up by the drain misbehaved:
Apply the offsets-flavor release only to old_inst's own entry and drain followers with the void flavor, matching the equivalent drain in release_storage_immediate.
Adds two DeferredAllocBadPathTest units covering both follower shapes; on the unfixed code they reproduce the two assertion failures exactly.
Adjudicated as BUG-7 in tla/allocation/bugs/BUG-7.md (checked in separately with the deferred-allocation verification campaign).