Repository navigation
fix(rustlantis): invalidate nested pointer edges on uninit - #1159
Merged
nihalpasham merged 2 commits intoAug 28, 2026
Merged
Conversation
Signed-off-by: Raul Estrada <[email protected]>
Collaborator
|
This PR is not blocked by a dependency or by the pointer-contract refactor; it remains open for normal correctness review.
Those regression, negative, and control checks follow the Discord acceptance criteria. |
Collaborator
|
Fix verified sound:
One test gap, which I closed at landing: the tuple-only test can't tell this fix from the plausible wrong one (cutting edges inside the run-pointer-bounded walk), because tuples have no RunPointer: I added the array case, an enum-variant pointer case, a |
…r invalidation The PR's tuple test passes even if the Deref-edge removal is folded into the RunPointer-bounded update walk, because tuples get no RunPointer of their own. An array of pointers is the distinguishing case: the array node owns the RunPointer and the memory-bounded walk stops there, so only the structural subfield walk reaches the pointer elements. Add three tests next to the existing one: - an [*const i32; 2] place whose elements must lose their outgoing Deref edges on uninit while an external incoming reference to the array survives; - an enum whose active variant holds a pointer field, which must lose its Deref edge when the enum place is marked uninit; - a mark_place_moved integration case proving a move of a tuple with a nested pointer invalidates the nested Deref edge end to end. Signed-off-by: nihalpasham <[email protected]>
nihalpasham
approved these changes
Aug 28, 2026
nihalpasham
left a comment
Collaborator
There was a problem hiding this comment.
Fix plus the added adversarial tests verified, fail-on-base recorded; CI green. Merging.
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.
Closes #1158
Summary
Make
PlaceGraph::mark_place_uninitremove outgoingDerefedges from pointer/reference values contained transitively in the place being marked uninitialized.Previously,
mark_place_uninitonly removed the edge when the root place itself was a pointer, leaving stale graph edges for pointers nested inside aggregates.Implementation
The change performs a structural traversal over the place and its subfields before marking the underlying storage uninitialized.
For each pointer/reference node encountered, its outgoing
Derefedge is removed.This traversal is intentionally separate from the existing memory invalidation traversal. The latter stops at nodes backed by a
RunPointer, which is correct for clearing bytes but would otherwise prevent discovery of nested pointer nodes.Incoming
Derefedges are not removed. References outside the value that point into its storage therefore retain their graph relationship.Tests
Added a regression test covering an aggregate containing nested:
The test verifies that:
Derefedges are removed aftermark_place_uninitValidation
From
crates/fuzzer/rustlantis:From the repository root: