fix: Dereferencing freed memos when verifying provisional memos#788
Merged
MichaReiser merged 2 commits intosalsa-rs:masterfrom Apr 9, 2025
Merged
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #788 will not alter performanceComparing Summary
|
5536c7c to
8b820db
Compare
MichaReiser
commented
Apr 9, 2025
560b74f to
149f615
Compare
carljm
approved these changes
Apr 9, 2025
149f615 to
7e8c8e0
Compare
7e8c8e0 to
d33d824
Compare
Merged
This was referenced Apr 9, 2025
carljm
pushed a commit
to astral-sh/ruff
that referenced
this pull request
Apr 9, 2025
## Summary Update Salsa to pull in salsa-rs/salsa#788 which fixes the, by now, famous *access to field whilst the value is being initialized*. This PR also re-enables all tests that previously triggered the panic. ## Test Plan `cargo test`
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.
Fixes #785
The root cause of #785 is that Salsa tries to load the memo of a cycle head that is stored on a tracked struct that has been freed.
The main problem is that we tried to verify
validate_provisionaleven in cases where the query is from a past revision, in which case we can't trust any inputs to still exist (and be valid).The fix in this PR is to change the order in which
shallow_verifyandvalidate_provisionalare called. This requires extracting the mutating bits out ofshallow_verifybecause we only want to call those if the struct isn't provisional (at least, that's what we did before and I tried to preserve this behavior).