| Index: runtime/vm/profiler.cc
|
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
|
| index b8827c58e7f1109068c6035ea041db8114e01ae2..271c09c89d8f7b16c15a7dae925cf0ee7ee91e26 100644
|
| --- a/runtime/vm/profiler.cc
|
| +++ b/runtime/vm/profiler.cc
|
| @@ -948,6 +948,14 @@ 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 uintptr_t started_dump = 0;
|
| + if (AtomicOperations::FetchAndIncrement(&started_dump) != 0) {
|
| + OS::PrintErr("Aborting re-entrant request for stack trace.\n");
|
| + return;
|
| + }
|
| +
|
| Thread* thread = Thread::Current();
|
| if (thread == NULL) {
|
| return;
|
|
|