aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2019-03-14 17:03:49 -0400
committerMike Frysinger <vapier@chromium.org>2019-03-14 21:53:16 +0000
commit8547289da5004ffb4357074914e94a140bf66a9b (patch)
tree98d75d91f092829deba706dde4756b7157939552 /src/client
parentlinux_core_dumper: support setting exception_information (diff)
downloadbreakpad-8547289da5004ffb4357074914e94a140bf66a9b.tar.xz
linux_core_dumper: handle missing SIGSYS support
If the kernel/C library headers are old, they might not have the fields needed for SIGSYS decoding. Add ifdef checks for that and skip the logic entirely. Easier than adding arch-specific siginfo structs to the codebase. Bug: google-breakpad:791 Change-Id: Ia473e3ffa61fce4c42cf4c1e73a9df044599bc5c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1524447 Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/linux/minidump_writer/linux_core_dumper.cc2
-rw-r--r--src/client/linux/minidump_writer/linux_core_dumper_unittest.cc6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/client/linux/minidump_writer/linux_core_dumper.cc b/src/client/linux/minidump_writer/linux_core_dumper.cc
index b24573b1..3b1eabb4 100644
--- a/src/client/linux/minidump_writer/linux_core_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_core_dumper.cc
@@ -248,7 +248,9 @@ bool LinuxCoreDumper::EnumerateThreads() {
set_crash_exception_info({info->si_pid, info->si_uid});
break;
case MD_EXCEPTION_CODE_LIN_SIGSYS:
+#ifdef si_syscall
set_crash_exception_info({info->si_syscall, info->si_arch});
+#endif
break;
}
break;
diff --git a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
index 927d5aa3..5f27d893 100644
--- a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
+++ b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
@@ -135,6 +135,12 @@ TEST(LinuxCoreDumperTest, VerifyExceptionDetails) {
return;
}
+#ifndef si_syscall
+ fprintf(stderr, "LinuxCoreDumperTest.VerifyDumpWithMultipleThreads test is "
+ "skipped due to old kernel/C library headers\n");
+ return;
+#endif
+
const unsigned kNumOfThreads = 2;
const unsigned kCrashThread = 1;
const int kCrashSignal = SIGSYS;