Chromium Code Reviews| Index: runtime/vm/profiler.cc |
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
| index b8827c58e7f1109068c6035ea041db8114e01ae2..ab1d2ebc4d7da14828302568bc484265d4adf240 100644 |
| --- a/runtime/vm/profiler.cc |
| +++ b/runtime/vm/profiler.cc |
| @@ -948,6 +948,15 @@ static uintptr_t __attribute__((noinline)) GetProgramCounter() { |
| void Profiler::DumpStackTrace(bool native_stack_trace) { |
| + // Allow only one stack trace to prevent recursively printing stack traces if |
| + // we hit an assert while printing the stack. |
| + static bool started_dump = false; |
|
zra
2016/08/10 17:52:27
It probably doesn't matter that this is not thread
rmacnak
2016/08/11 00:08:02
Done.
|
| + if (started_dump) { |
| + OS::PrintErr("Aborting re-entrant request for stack trace.\n"); |
| + return; |
| + } |
| + started_dump = true; |
| + |
| Thread* thread = Thread::Current(); |
| if (thread == NULL) { |
| return; |