diff options
author | monojenkins <jo.shields+jenkins@xamarin.com> | 2020-06-20 05:58:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-20 05:58:21 +0300 |
commit | 15782aa7404c7d436045e7ebf2abbb9c2a95153e (patch) | |
tree | 68654c4a640407f3c6f0154ea9c4b8408b3b7241 | |
parent | 6ea4cbcee040956cceaa53058cdb7de6529d2db0 (diff) |
If there is a crash and the debugger is attached, we call mini_get_dbg_callbacks ()->send_crash(). That call ends up in mono_debugger_agent_send_crash which does all kinds of questionable stuff like trying to take the loader lock. Eventually it ends up calling socket_transport_send which tries to do a transition to GC Safe mode. I inserted a MONO_ENTER_GC_UNSAFE in mono_debugger_agent_send_crash function and this fixes the assert. (#19992)
Fixes #18794
Co-authored-by: Thays Grazia <thaystg@gmail.com>
-rw-r--r-- | mono/mini/debugger-agent.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index 08a709becc3..c94750657f1 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -5147,6 +5147,7 @@ ss_clear_for_assembly (SingleStepReq *req, MonoAssembly *assembly) static void mono_debugger_agent_send_crash (char *json_dump, MonoStackHash *hashes, int pause) { + MONO_ENTER_GC_UNSAFE; #ifndef DISABLE_CRASH_REPORTING int suspend_policy; GSList *events; @@ -5189,6 +5190,7 @@ mono_debugger_agent_send_crash (char *json_dump, MonoStackHash *hashes, int paus // Don't die before it is sent. sleep (4); #endif + MONO_EXIT_GC_UNSAFE; } /* |