diff --git a/handler/linux/cros_crash_report_exception_handler.cc b/handler/linux/cros_crash_report_exception_handler.cc index a3a68552..86142883 100644 --- a/handler/linux/cros_crash_report_exception_handler.cc +++ b/handler/linux/cros_crash_report_exception_handler.cc @@ -17,6 +17,7 @@ #include #include "base/logging.h" +#include "base/strings/stringprintf.h" #include "client/settings.h" #include "handler/linux/capture_snapshot.h" #include "handler/minidump_to_upload_parameters.h" @@ -246,6 +247,16 @@ bool CrosCrashReportExceptionHandler::HandleExceptionWithConnection( // crash_reporter needs to know the pid and uid of the crashing process. std::vector argv({"/sbin/crash_reporter"}); + // Used to distinguish between non-fatal and fatal crashes. + const ExceptionSnapshot* const exception_snapshot = snapshot->Exception(); + if (exception_snapshot) { + // convert to int32, since crashpad uses -1 as a signal for non-fatal + // crashes. + argv.push_back(base::StringPrintf( + "--chrome_signal=%d", + static_cast(exception_snapshot->Exception()))); + } + argv.push_back("--chrome_memfd=" + std::to_string(file_writer.fd())); const pid_t pid = process_snapshot->ProcessID();