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

Unified Diff: runtime/vm/profiler.cc

Issue 2990393002: [vm] Make the crash reporter more resilient to crashes during safepoints. (Closed)
Patch Set: . Created 3 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 a3fb9c6c90a7e83438908ef7d0907464d963b576..82053db9f58dac80b7d4b9b9a42e3ebf6cba232e 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -406,17 +406,20 @@ void ClearProfileVisitor::VisitSample(Sample* sample) {
}
static void DumpStackFrame(intptr_t frame_index, uword pc) {
- Isolate* isolate = Isolate::Current();
- if ((isolate != NULL) && isolate->is_runnable()) {
- Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc));
- if (!code.IsNull()) {
- OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName());
- return;
- }
- code = Code::LookupCode(pc);
- if (!code.IsNull()) {
- OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName());
- return;
+ Thread* thread = Thread::Current();
+ if ((thread != NULL) && !thread->IsAtSafepoint()) {
+ Isolate* isolate = thread->isolate();
+ if ((isolate != NULL) && isolate->is_runnable()) {
+ // Only attempt to symbolize Dart frames if we can safely iterate the
+ // current isolate's heap.
+ Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc));
+ if (!code.IsNull()) {
+ code = Code::LookupCode(pc); // In current isolate.
+ }
+ if (!code.IsNull()) {
+ OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName());
+ 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