From f59eac4c0f142c55814be14ae8667d8511171017 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Fri, 25 May 2018 13:39:30 -0400 Subject: [profiler] Don't raise events until the profiler transitions to the ready state. Fixes #8866. We can't raise event before that as the profiler depends on too much runtime infrastructure at this point for it to reliably work. For example, we need the threading infrastructure to be init'd so we can access the thread-local profiler state to store events there. --- mono/metadata/profiler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c index c1850434cc4..db4c08b6b4c 100644 --- a/mono/metadata/profiler.c +++ b/mono/metadata/profiler.c @@ -894,6 +894,7 @@ update_callback (volatile gpointer *location, gpointer new_, volatile gint32 *co void \ mono_profiler_raise_ ## name params \ { \ + if (!mono_profiler_state.startup_done) return; \ for (MonoProfilerHandle h = mono_profiler_state.profilers; h; h = h->next) { \ MonoProfiler ## type ## Callback cb = h->name ## _cb; \ if (cb) \ -- cgit v1.2.3