Skip cleanup of eventpipe for mono to prevent crashes on shutdown#100938
Skip cleanup of eventpipe for mono to prevent crashes on shutdown#100938davmason merged 3 commits intodotnet:mainfrom
Conversation
noahfalk
left a comment
There was a problem hiding this comment.
Does this change fix the bug?
The callstack I see in the bug report is:
#20 ep_rt_mono_fini () at /__w/1/s/src/mono/mono/eventpipe/ep-rt-mono.c:892
#21 0x0000ffff935b4d68 in mini_cleanup (domain=) at /__w/1/s/src/mono/mono/mini/mini-runtime.c:5259
#22 0x0000ffff937814ac in ves_icall_System_Environment_Exit (result=42) at /__w/1/s/src/mono/mono/metadata/icall.c:6151
The call being removed in this PR is:
ep_rt_mono_fini
ep_rt_shutdown
|
@noahfalk I think it's just getting inlined in to |
|
I believe runtime/src/mono/mono/mini/mini-runtime.c Line 5272 in eb4bf70 Since I deleted the method, we should see build errors if there are still references to the function |
noahfalk
left a comment
There was a problem hiding this comment.
Makes sense, just wanted to double check. Thanks!
|
Fix will solve issue in the case where we do System.Environment.Exit where we won't make sure managed threads are full stopped when calling mini_cleanup that in turn will shutdown EventPipe while threads can still be active in EventPipe code. Under normal shutdown this won't be a problem so an alternative fix to still keep cleanup under normal situations could be to check if we are shutting down due to a System.Environement.Exit code in ep_rt_mono_fini like we already check mono_runtime_is_shutting_down, but I'm fine either way. |
lambdageek
left a comment
There was a problem hiding this comment.
This is ok, but I think it's valuable to unregister the profiler callbacks.
fixes #99609