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>
This commit is contained in:
Mike Frysinger 2019-03-14 17:03:49 -04:00
parent 3ee9a0b274
commit 8547289da5
2 changed files with 8 additions and 0 deletions

View file

@ -248,7 +248,9 @@ bool LinuxCoreDumper::EnumerateThreads() {
set_crash_exception_info({info->si_pid, info->si_uid}); set_crash_exception_info({info->si_pid, info->si_uid});
break; break;
case MD_EXCEPTION_CODE_LIN_SIGSYS: case MD_EXCEPTION_CODE_LIN_SIGSYS:
#ifdef si_syscall
set_crash_exception_info({info->si_syscall, info->si_arch}); set_crash_exception_info({info->si_syscall, info->si_arch});
#endif
break; break;
} }
break; break;

View file

@ -135,6 +135,12 @@ TEST(LinuxCoreDumperTest, VerifyExceptionDetails) {
return; 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 kNumOfThreads = 2;
const unsigned kCrashThread = 1; const unsigned kCrashThread = 1;
const int kCrashSignal = SIGSYS; const int kCrashSignal = SIGSYS;