-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling RequestReJIT in the profiler API can cause a deadlock #97771
Comments
Tagging subscribers to this area: @tommcdon Issue DetailsDescriptionWe experience an occasional deadlock while using ICorProfilerInfo4::RequestReJIT. Profiler thread:
CLR internal thread:
Profiler is holding a lock, while trying to acquire another lock, which is held by another internal CLR thread. It seems that setting Bigger thread dumpReproduction Steps
Expected behaviorNo deadlock. Actual behaviorDeadlock. Application hangs. Regression?No response Known WorkaroundsSet ConfigurationDebug runtime was built from .NET 7 branch.
Other informationNo response
|
Hi @kalikin, thanks for this report. We shouldn't hold the code version lock when calling in to RequestReJIT. Would you be able to add this commit to your branch and see if it fixes the deadlock for you? |
@davmason I've tried the change from this commit and no longer see deadlocks like before, regardless of Looks good to me. |
Thanks for validating, I opened #98400 to fix this issue |
Description
We experience an occasional deadlock while using ICorProfilerInfo4::RequestReJIT.
Profiler thread:
CLR internal thread:
Profiler is holding a lock, while trying to acquire another lock, which is held by another internal CLR thread.
It seems that setting
pfShouldInline
in ICorProfilerCallback::JITInlining callback has an effect on the issue.Bigger thread dump
thread-dump.txt
Reproduction Steps
pfShouldInline
toTRUE
in ICorProfilerCallback::JITInlining callback.Expected behavior
No deadlock.
Actual behavior
Deadlock. Application hangs.
Regression?
No response
Known Workarounds
Set
pfShouldInline
toFALSE
in ICorProfilerCallback::JITInlining callback.Configuration
Debug runtime was built from .NET 7 branch.
Other information
No response
The text was updated successfully, but these errors were encountered: