Bug 1861751 Part 4: Add tests of invalid buffers in various usages. r=webgpu-reviewer...
[gecko.git] / toolkit / crashreporter / breakpad-patches / 23-si-user-si-kernel-siginfo.patch
blob9e779f7dd8102fa7de5cb2c44d4d8dcf77c21003
1 diff --git a/src/google_breakpad/common/minidump_exception_linux.h b/src/google_breakpad/common/minidump_exception_linux.h
2 --- a/src/google_breakpad/common/minidump_exception_linux.h
3 +++ b/src/google_breakpad/common/minidump_exception_linux.h
4 @@ -83,16 +83,20 @@ typedef enum {
5 MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF /* No exception,
6 dump requested. */
7 } MDExceptionCodeLinux;
9 /* For (MDException).exception_flags. These values come from
10 * asm-generic/siginfo.h.
12 typedef enum {
13 + /* Generic */
14 + MD_EXCEPTION_FLAG_LIN_SI_USER = 0,
15 + MD_EXCEPTION_FLAG_LIN_SI_KERNEL = 0x80,
17 /* SIGILL */
18 MD_EXCEPTION_FLAG_LIN_ILL_ILLOPC = 1,
19 MD_EXCEPTION_FLAG_LIN_ILL_ILLOPN = 2,
20 MD_EXCEPTION_FLAG_LIN_ILL_ILLADR = 3,
21 MD_EXCEPTION_FLAG_LIN_ILL_ILLTRP = 4,
22 MD_EXCEPTION_FLAG_LIN_ILL_PRVOPC = 5,
23 MD_EXCEPTION_FLAG_LIN_ILL_PRVREG = 6,
24 MD_EXCEPTION_FLAG_LIN_ILL_COPROC = 7,
25 diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc
26 --- a/src/processor/minidump_processor.cc
27 +++ b/src/processor/minidump_processor.cc
28 @@ -1401,16 +1401,22 @@ string MinidumpProcessor::GetCrashReason
29 reason = "SIGTRAP";
30 break;
31 case MD_EXCEPTION_CODE_LIN_SIGABRT:
32 reason = "SIGABRT";
33 break;
34 case MD_EXCEPTION_CODE_LIN_SIGBUS:
35 reason = "SIGBUS / ";
36 switch (exception_flags) {
37 + case MD_EXCEPTION_FLAG_LIN_SI_USER:
38 + reason.append("SI_USER");
39 + break;
40 + case MD_EXCEPTION_FLAG_LIN_SI_KERNEL:
41 + reason.append("SI_KERNEL");
42 + break;
43 case MD_EXCEPTION_FLAG_LIN_BUS_ADRALN:
44 reason.append("BUS_ADRALN");
45 break;
46 case MD_EXCEPTION_FLAG_LIN_BUS_ADRERR:
47 reason.append("BUS_ADRERR");
48 break;
49 case MD_EXCEPTION_FLAG_LIN_BUS_OBJERR:
50 reason.append("BUS_OBJERR");
51 @@ -1462,18 +1468,24 @@ string MinidumpProcessor::GetCrashReason
52 break;
53 case MD_EXCEPTION_CODE_LIN_SIGKILL:
54 reason = "SIGKILL";
55 break;
56 case MD_EXCEPTION_CODE_LIN_SIGUSR1:
57 reason = "SIGUSR1";
58 break;
59 case MD_EXCEPTION_CODE_LIN_SIGSEGV:
60 - reason = "SIGSEGV /";
61 + reason = "SIGSEGV / ";
62 switch (exception_flags) {
63 + case MD_EXCEPTION_FLAG_LIN_SI_USER:
64 + reason.append("SI_USER");
65 + break;
66 + case MD_EXCEPTION_FLAG_LIN_SI_KERNEL:
67 + reason.append("SI_KERNEL");
68 + break;
69 case MD_EXCEPTION_FLAG_LIN_SEGV_MAPERR:
70 reason.append("SEGV_MAPERR");
71 break;
72 case MD_EXCEPTION_FLAG_LIN_SEGV_ACCERR:
73 reason.append("SEGV_ACCERR");
74 break;
75 case MD_EXCEPTION_FLAG_LIN_SEGV_BNDERR:
76 reason.append("SEGV_BNDERR");