From c6fe427cccc166ece2d57bc45e91a8f5aad0661b Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 1 Jun 2017 20:14:58 -0700 Subject: ART: Refactor HandleUnexpectedSignalCommon Avoid the std::ostringstream. Instead use a lambda and immediately use std::cerr when asked to dump there, eventually. Also refactor the signature to make it more explicit what the function will handle and where it would dump to. Test: m test-art-host Change-Id: I2be5497d4f9957127243879113372d9aa1535d82 --- runtime/runtime_linux.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/runtime_linux.cc') diff --git a/runtime/runtime_linux.cc b/runtime/runtime_linux.cc index ad61cf373b..424dcf85cf 100644 --- a/runtime/runtime_linux.cc +++ b/runtime/runtime_linux.cc @@ -25,7 +25,13 @@ namespace art { void HandleUnexpectedSignalLinux(int signal_number, siginfo_t* info, void* raw_context) { - HandleUnexpectedSignalCommon(signal_number, info, raw_context, /* running_on_linux */ true); + // Linux is mainly used for host testing. Under those conditions, react to the timeout signal, + // and dump to stderr to avoid missing output on double-faults. + HandleUnexpectedSignalCommon(signal_number, + info, + raw_context, + /* handle_timeout_signal */ true, + /* dump_on_stderr */ true); if (getenv("debug_db_uid") != nullptr || getenv("art_wait_for_gdb_on_crash") != nullptr) { pid_t tid = GetTid(); -- cgit v1.2.3-59-g8ed1b