Skip to content

Commit

Permalink
[mono][debugger] Fix deadlock when debugging AOTed class (#57574)
Browse files Browse the repository at this point in the history
* Fix deadlock when debugging AOTed class

* fix comment.
  • Loading branch information
thaystg authored Aug 17, 2021
1 parent 078af6b commit 04b6370
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -4081,6 +4081,13 @@ jit_end (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo)
}
}

// only send typeload from AOTed classes if has .cctor when .cctor emits jit_end
// to avoid deadlock while trying to set a breakpoint in a class that was not fully initialized
if (jinfo->from_aot && m_class_has_cctor(method->klass) && (!(method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) || strcmp (method->name, ".cctor")))
{
return;
}

send_type_load (method->klass);

if (m_class_get_image(method->klass)->has_updates) {
Expand Down

0 comments on commit 04b6370

Please sign in to comment.