Repository navigation
fix(segment): merged free span keeps its neighbour's purged flag (released as 2.2.6) - #54
Open
Ttimmahlax wants to merge 2 commits into
Open
Ttimmahlax wants to merge 2 commits into
Ttimmahlax wants to merge 2 commits into
Conversation
Mechanism B of docs/plans/recommit-failure-ignored.md. span_recommit reads only a free span's FIRST slot. span_free merges with free neighbours and re-purges the whole merged span, but not when the purge fails or purging was switched off at runtime; the merged span then kept its first part's clear flag over a decommitted neighbour, and the next tenant wrote to it. Reproduced on Windows as 0xc0000005 STATUS_ACCESS_VIOLATION, the field crash's exception. The merged start now keeps the flag if any part was purged (a spurious flag only re-commits committed memory). Tests: two merge tests (a failed re-purge via a new test-only "fail the next N purges" hook in os::purge; purging turned off at runtime), poisoned: both fail with the fix disabled. They and the mechanism-A test set the process-wide purge_delay, so all three hold arena::adopt_tests::lock, which also stops them taking a chunk from an arena an adoption test has just adopted (each raced about 1 run in 12 without it; 30/30 clean with it). Cost: about 2 Ir per span_free. Opscan unchanged on every op; allocator Ir perl +455 (0.002 %), Endless Sky +68. Unsafe census +10, all test-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.2.6 (2.2.5 + the merged-span purge fix) was cut from the 2.2.5 tag and published by hand, so the speed work held on main for a week did not ship with it. main's version and changelogs now say so; the speed work stays under Unreleased for its own release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Brings
mainup to date with 2.2.6, which is already on crates.io.2.2.6 = 2.2.5 + this fix, cut from the
rusty_alloc-v2.2.5tag and published by hand (tagsrusty_alloc-v2.2.6/rusty_alloc-api-v2.2.6on61ae839; CI on that exact tree via draft #53), becausemaincarries the speed work from #51, which is held for a week.The fix (mechanism B of
docs/plans/recommit-failure-ignored.md):span_freemerges a freed span with free neighbours, and when the merged span is not re-purged as a whole (the purge fails, or purging was switched off at runtime) it kept a clearpurgedflag over a decommitted neighbour; the next tenant wrote to it. Reproduced on Windows as0xc0000005 STATUS_ACCESS_VIOLATION. Now the merged start keeps the flag if any part was purged. Cost: ~2 Ir perspan_free; opscan unchanged; perl +0.002 %.Tests: two merge tests (poisoned: both fail with the fix disabled), a test-only "fail the next N purges" hook, and the re-commit tests now hold the arena tests' lock (they raced ~1 in 12 without it; 30/30 clean with it).
Second commit:
main's version moves to 2.2.6 and the changelogs get a 2.2.6 section; the speed work stays under Unreleased, so release-plz proposes its own version after 2.2.6.🤖 Generated with Claude Code