Repository navigation
Fix data race in LRUFileCachePriority::LRUIterator::invalidate - #95064
Merged
Merged
Conversation
The `invalidate` method was taking a reference to the `EntryPtr` stored in the list node. When another thread called `removeEntries` which erases the list node, the reference became dangling, causing use-after-free when accessing entry members. The fix copies the `EntryPtr` instead of taking a reference, ensuring the `Entry` object remains valid even if the list node is deleted. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
|
Workflow [PR], commit [1a4b0b5] Summary: ❌
|
This was referenced Jan 25, 2026
Closed
Closed
Closed
Closed
Member
|
@alexey-milovidov this is not a correct fix and does not fix the problem, and I have a proper fix here #95042. Please do not merge PRs without review. |
Member
Author
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.
Linked issues
The
invalidatemethod was taking a reference to theEntryPtrstored in the list node. When another thread calledremoveEntrieswhich erases the list node, the reference became dangling, causing use-after-free when accessing entry members.The fix copies the
EntryPtrinstead of taking a reference, ensuring theEntryobject remains valid even if the list node is deleted.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix data race in the filesystem cache.
See https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=95057&sha=855aaba0e6750a51d95794122c0dca211f5c4e69&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20sequential%2C%202%2F2%29
#95057
Version info
26.1.1.846