ART: Change thread dump order on abort
Dump the aborting thread last, in an effort to have it appear in
the logcat.
Bug: 64689630
Test: m test-art-host
Change-Id: Ib9148b542a950545a5873e7ca71d3d3b2cefbd1f
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index a8ccf89..a67a6aa 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -417,6 +417,12 @@
return;
}
Thread* self = Thread::Current();
+
+ // Dump all threads first and then the aborting thread. While this is counter the logical flow,
+ // it improves the chance of relevant data surviving in the Android logs.
+
+ DumpAllThreads(os, self);
+
if (self == nullptr) {
os << "(Aborting thread was not attached to runtime!)\n";
DumpKernelStack(os, GetTid(), " kernel: ", false);
@@ -432,7 +438,6 @@
}
}
}
- DumpAllThreads(os, self);
}
// No thread-safety analysis as we do explicitly test for holding the mutator lock.