[merp] Put thread into async context before running summarizer (mono/mono#17194)
authorAleksey Kliger (λgeek) <alklig@microsoft.com>
Sat, 5 Oct 2019 17:01:56 +0000 (13:01 -0400)
committerGitHub <noreply@github.com>
Sat, 5 Oct 2019 17:01:56 +0000 (13:01 -0400)
commit009d5e9ab2e42fc564ff53f5c519d47969a3d2af
tree09ab71e3c315444e04029f55440501974c5c8c39
parent0bce00ee5a504ee66bb097ccd7765c4c89ddbaf4
[merp] Put thread into async context before running summarizer (mono/mono#17194)

Followup work for https://github.com/mono/mono/pull/17090

In order to get managed method info for unmanaged stacktraces, we call
mini_jit_info_table_find_ext which calls decode_exception_debug_info which may
allocate if it's not in async context.

Do the switch in mono_threads_summarize_execute so that non-supervising threads
all switch when they run the sigterm_signal_handler.  mono_threads_summarize
already does it for the supervisor thread.

Fixes https://github.com/mono/mono/issues/17180

Commit migrated from https://github.com/mono/mono/commit/cb52186661254bb17e809ccb753198e7e59c2d90
src/mono/mono/metadata/threads.c