Fix windows profiler deadlock#60056
Merged
Keno merged 3 commits intoJuliaLang:masterfrom Nov 10, 2025
Merged
Conversation
Member
|
I agree that this fixes the issue, but it also feels like it may be a libuv bug? libuv already creates a duplicate handle for |
Member
|
This function is a promise to libuv that you will never run any libuv code on that thread ever again, so it is basically just use-after-free |
vtjnash
approved these changes
Nov 10, 2025
Member
|
Ok, but that seems like a big caveat missing from the documentation, because that's not how pthread works. |
KristofferC
pushed a commit
that referenced
this pull request
Nov 10, 2025
Wasn't sure if we could get away with deleting the `uv_thread_detach`, but apparently we can. On Windows, it's definitely unsafe to keep using the thread handle after closing it. POSIX is a little less clear about what you're allowed to do with a `pthread_t` after detaching it, but the GC threads never exit normally anyway. Fixes #60042. (cherry picked from commit d8b5662)
Keno
added a commit
to Keno/libuv-1
that referenced
this pull request
Nov 10, 2025
This seems like an important caveat, but was not documented. Ref JuliaLang/julia#60056 (comment)
KristofferC
pushed a commit
that referenced
this pull request
Nov 11, 2025
Wasn't sure if we could get away with deleting the `uv_thread_detach`, but apparently we can. On Windows, it's definitely unsafe to keep using the thread handle after closing it. POSIX is a little less clear about what you're allowed to do with a `pthread_t` after detaching it, but the GC threads never exit normally anyway. Fixes #60042. (cherry picked from commit d8b5662)
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.
Wasn't sure if we could get away with deleting the
uv_thread_detach, butapparently we can. On Windows, it's definitely unsafe to keep using the thread
handle after closing it. POSIX is a little less clear about what you're allowed
to do with a
pthread_tafter detaching it, but the GC threads never exitnormally anyway.
Fixes #60042.