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; |
} |