Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: runtime/vm/profiler.cc

Issue 2230713005: Guard against re-entrant requests for stack traces. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698