void HandleUnexpectedSignalLinux(int signal_number, siginfo_t* info, void* raw_context) { // 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();
std::string thread_name(GetThreadName(tid));
std::cerr << "********************************************************\n"
<< "* Process " << getpid() << " thread " << tid << " \"" << thread_name
<< "\""
<< " has been suspended while crashing.\n"
<< "* Attach gdb:\n"
<< "* gdb -p " << tid << "\n"
<< "********************************************************"
<< std::endl; // Wait for debugger to attach. while (true) {
}
} #ifdef __linux__ // Remove our signal handler for this signal... struct sigaction action;
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_DFL;
sigaction(signal_number, &action, nullptr); // ...and re-raise so we die with the appropriate status.
kill(getpid(), signal_number); #else exit(EXIT_FAILURE); #endif
}
void Runtime::InitPlatformSignalHandlers() {
constexpr bool kIsASAN = #ifdef ADDRESS_SANITIZER true; #else false; #endif if (!kIsTargetBuild && kIsASAN) { // (Temporarily) try and let ASAN print abort stacks, as our code sometimes fails. b/31098551 return;
} // On the host, we don't have debuggerd to dump a stack for us when something unexpected happens.
InitPlatformSignalHandlersCommon(HandleUnexpectedSignalLinux,
nullptr, /* handle_timeout_signal= */ true);
}
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.