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

Unified Diff: runtime/vm/isolate.cc

Issue 13939003: Fixed stack trace for isolates without any Dart frames. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed divide-by-zero error in bargraph.dart Created 7 years, 8 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 | « runtime/bin/vmstats/vmstats.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
===================================================================
--- runtime/vm/isolate.cc (revision 21220)
+++ runtime/vm/isolate.cc (working copy)
@@ -884,18 +884,33 @@
if (status_sync == NULL) {
status_sync = new Monitor();
}
+ bool is_main_isolate = (strstr(name(), "$main-") != NULL);
ScheduleInterrupts(Isolate::kVmStatusInterrupt);
{
MonitorLocker ml(status_sync);
if (stacktrace_ == NULL) { // It may already be available.
- ml.Wait();
+ if (is_main_isolate) {
+ // Main isolate may have finished, but waiting for other isolates
+ // to finish. If so, it won't respond to interrupts.
+ ml.Wait(500);
Ivan Posva 2013/04/12 14:37:36 This is quite unfortunate. There must be a way to
+ } else {
+ ml.Wait();
+ }
}
}
SetVmStatsCallback(NULL);
- ASSERT(stacktrace_ != NULL);
- // result is freed by VmStats::WebServer().
char* result = stacktrace_;
stacktrace_ = NULL;
+ if (is_main_isolate && result == NULL) {
Ivan Posva 2013/04/12 14:37:36 Why do we only care about the main isolate here? A
Tom Ball 2013/04/16 18:11:02 Replaced main-only test, with test for whether iso
+ // Return empty stack.
+ TextBuffer buffer(256);
+ buffer.Printf("{ \"handle\": \"0x%"Px64"\", \"stacktrace\": []}",
+ reinterpret_cast<int64_t>(this));
+
+ result = strndup(buffer.buf(), buffer.length());
+ }
+ ASSERT(result != NULL);
+ // result is freed by VmStats::WebServer().
return result;
}
« no previous file with comments | « runtime/bin/vmstats/vmstats.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698