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

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: 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 21569)
+++ runtime/vm/isolate.cc (working copy)
@@ -885,18 +885,28 @@
if (status_sync == NULL) {
status_sync = new Monitor();
}
- ScheduleInterrupts(Isolate::kVmStatusInterrupt);
- {
- MonitorLocker ml(status_sync);
- if (stacktrace_ == NULL) { // It may already be available.
- ml.Wait();
+ if (is_runnable()) {
+ ScheduleInterrupts(Isolate::kVmStatusInterrupt);
+ {
+ MonitorLocker ml(status_sync);
+ if (stacktrace_ == NULL) { // It may already be available.
+ ml.Wait(1000);
+ }
}
+ SetVmStatsCallback(NULL);
}
- SetVmStatsCallback(NULL);
- ASSERT(stacktrace_ != NULL);
- // result is freed by VmStats::WebServer().
char* result = stacktrace_;
stacktrace_ = NULL;
+ if (result == NULL) {
+ // 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