From c49eb9a6804c03ef12d7f0cd990aaaf4e8192e60 Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Thu, 17 Nov 2016 10:14:53 -0800 Subject: [PATCH] Disable Dart's profiler in unoptimized builds (flutter/engine#3234) --- engine/src/flutter/runtime/dart_init.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/src/flutter/runtime/dart_init.cc b/engine/src/flutter/runtime/dart_init.cc index 2cdfd538c2..f277b69254 100644 --- a/engine/src/flutter/runtime/dart_init.cc +++ b/engine/src/flutter/runtime/dart_init.cc @@ -83,6 +83,12 @@ static const char* kDartProfilingArgs[] = { // default profile period to 100Hz. This number is suitable for older // Raspberry Pi devices but quite low for current smartphones. "--profile_period=1000", + // Disable Dart's built in profiler when building a debug build. This + // works around a race condition that would sometimes stop a crash's + // stack trace from being printed on Android. +#ifndef NDEBUG + "--no-profiler", +#endif #if (WTF_OS_IOS || WTF_OS_MACOSX) // On platforms where LLDB is the primary debugger, SIGPROF signals // overwhelm LLDB.