Skip to content

Commit

Permalink
[merp] Put thread into async context before running summarizer
Browse files Browse the repository at this point in the history
[merp] Put thread into async context before running summarizer

Followup work for mono#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 mono#17180

Backport of mono#17194.

/cc @lambdageek
  • Loading branch information
monojenkins authored and lambdageek committed Oct 11, 2019
1 parent 1e2d850 commit 92539e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mono/metadata/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -6619,7 +6619,14 @@ mono_threads_summarize_execute_internal (MonoContext *ctx, gchar **out, MonoStac
gboolean
mono_threads_summarize_execute (MonoContext *ctx, gchar **out, MonoStackHash *hashes, gboolean silent, gchar *working_mem, size_t provided_size)
{
return mono_threads_summarize_execute_internal (ctx, out, hashes, silent, working_mem, provided_size, FALSE);
gboolean result;
gboolean already_async = mono_thread_info_is_async_context ();
if (!already_async)
mono_thread_info_set_is_async_context (TRUE);
result = mono_threads_summarize_execute_internal (ctx, out, hashes, silent, working_mem, provided_size, FALSE);
if (!already_async)
mono_thread_info_set_is_async_context (FALSE);
return result;
}

gboolean
Expand Down

0 comments on commit 92539e1

Please sign in to comment.