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

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..4de16a6926020198433bad805e8ddf01a2070a56 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -406,17 +406,22 @@ 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()) {
+ // Attempt to symbolize Dart frames if we have can safely iterate the
+ // current isolate's heap.
danunez 2017/08/08 20:44:02 This comment is unclear to me. It reads like there
rmacnak 2017/08/09 17:58:39 Deleted "have"
+ 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;
+ }
siva 2017/08/08 23:59:55 why not Code& code = Code::Handle(Code::LookupCo
rmacnak 2017/08/09 17:58:39 Done.
}
}
« 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