-
Couldn't load subscription status.
- Fork 5.2k
Exit with quick_exit when using debug UCRT #109006
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
Conversation
|
I expect that this will break tracing tests. Tracing depends on C runtime shutdown notification to close the session:
Also, the same fundamental problem exists in regular coreclr as well. |
|
It seems that the only way to fix the problem and keep the cleanup at exit untouched would be to link to ucrt dynamically. The cleanup then occurs in DllMain of the library on DLL_PROCESS_DETACH. |
|
I meant the low level CRT cleanup, not the atexit stuff. |
Ah, damn, that's C++ and not in ucrt, so that would not help. |
There is no C++ in the mix. Neither
|
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
It looks like we do not have any diagnostics tests that would be sensitive for improperly closed eventpipe sessions. I think we should also update #109006 (comment) to register the callbacks using Looks good to me otherwise. |
Why don't we do it currently? |
We do not dynamically link to debug CRT to save us from troubles with deploying it to CI machines. We do dynamically link to release CRT (ie the shipping bits link to release CRT). |
|
Thanks, I remember trying to link some static libraries with dynamic CRT linkage and getting errors related to static/dynamic CRT mismatch. But that was years ago and I will try it again. |
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| #if defined(HOST_WINDOWS) || defined(FEATURE_PERFTRACING) | ||
| atexit(&OnProcessExit); | ||
| #if defined(HOST_WINDOWS) | ||
| at_quick_exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changing the behavior of shipping release bits. at_quick_exit handlers are not called on normal program termination.
OnProcessExit is no longer called on normal program termination -> the tracing shutdown is no longer during shutdown -> we should see tracing tests fail -> we have a test hole since no tracing tests are failing.
I am leaving a suggestion with a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #114461 for the test hole.
Co-authored-by: Jan Kotas <[email protected]>
Resolves #108640.
Cc @dotnet/ilc-contrib @janvorli