Repository navigation
Erase compiled functions from every thread's compile cache - #4940
Merged
zcbenz merged 2 commits intoNov 28, 2026
Merged
Conversation
KavinP21
force-pushed
the
fix-compile-erase-all-thread-caches
branch
from
November 26, 2026 23:45
d1c3993 to
b086ae4
Compare
Contributor
Author
Sure. I just rebased on the latest main. The conflict should be resolved now. |
zcbenz
reviewed
Nov 28, 2026
zcbenz
left a comment
Member
There was a problem hiding this comment.
Sorry for the late review, so I think we can not accept this PR because it is unsafe to free compiled function in another thread as it might be being used.
Member
|
Hmm after thinking more about this I think might be able to work. |
This patch removes the function’s entries from every cache it was traced in instead of just one
zcbenz
force-pushed
the
fix-compile-erase-all-thread-caches
branch
from
November 28, 2026 10:51
b086ae4 to
51a5c9a
Compare
zcbenz
approved these changes
Nov 28, 2026
zcbenz
force-pushed
the
fix-compile-erase-all-thread-caches
branch
from
November 28, 2026 10:55
51a5c9a to
f20424a
Compare
zcbenz
force-pushed
the
fix-compile-erase-all-thread-caches
branch
from
November 28, 2026 11:14
f20424a to
209d399
Compare
1 task done
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 compile cache is per thread, but compiled functions only remembered one cache to clean up. Releasing a function used by multiple threads could leave stale entries that a new function at the same address would reuse, producing incorrect results. This patch tracks every cache the function was traced in, removes its entries from all of them on release, and adds a test.
Fixes #4933