OSDN Git Service

ART: Enable native stack dumping on timeout
authorAndreas Gampe <agampe@google.com>
Wed, 9 Mar 2016 04:29:49 +0000 (20:29 -0800)
committerAndreas Gampe <agampe@google.com>
Wed, 9 Mar 2016 04:36:04 +0000 (20:36 -0800)
To better investigate timeout in tests, allow dumping of native
stacks.

Bug: 27508829
Change-Id: Icf5420cde386cd80a1f45400c86545c89b1e2cc2

runtime/runtime_linux.cc

index 8237b06..bc963c5 100644 (file)
@@ -36,6 +36,7 @@ namespace art {
 
 static constexpr bool kDumpHeapObjectOnSigsevg = false;
 static constexpr bool kUseSigRTTimeout = true;
+static constexpr bool kDumpNativeStackOnTimeout = true;
 
 struct Backtrace {
  public:
@@ -350,7 +351,9 @@ void HandleUnexpectedSignal(int signal_number, siginfo_t* info, void* raw_contex
   if (runtime != nullptr) {
     if (IsTimeoutSignal(signal_number)) {
       // Special timeout signal. Try to dump all threads.
-      runtime->GetThreadList()->DumpForSigQuit(LOG(INTERNAL_FATAL));
+      // Note: Do not use DumpForSigQuit, as that might disable native unwind, but the native parts
+      //       are of value here.
+      runtime->GetThreadList()->Dump(LOG(INTERNAL_FATAL), kDumpNativeStackOnTimeout);
     }
     gc::Heap* heap = runtime->GetHeap();
     LOG(INTERNAL_FATAL) << "Fault message: " << runtime->GetFaultMessage();