summaryrefslogtreecommitdiff
blob: 719ed0df031aee7917a60b376f3f0b6f0543471d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# HG changeset patch
# User Felix Janda <felix.janda@posteo.de>
# Date 1423172597 -3600
#      Thu Feb 05 22:43:17 2015 +0100
# Node ID df5ec9e5685a52bcd19bbe566c0770daa40f14b1
# Parent  2d344ef8da33717224d5a08570dc834ca2254f9f
crashreporter: compile with musl

diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc	Thu Feb 05 22:43:17 2015 +0100
@@ -28,7 +28,6 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <assert.h>
-#include <dirent.h>
 #include <fcntl.h>
 #include <limits.h>
 #include <poll.h>
@@ -49,6 +48,8 @@
 #include "common/linux/guid_creator.h"
 #include "common/linux/safe_readlink.h"
 
+#include <dirent.h>
+
 static const char kCommandQuit = 'x';
 
 namespace google_breakpad {
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc	Thu Feb 05 22:43:17 2015 +0100
@@ -77,7 +77,7 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
-#include <sys/signal.h>
+#include <signal.h>
 #include <sys/ucontext.h>
 #include <sys/user.h>
 #include <ucontext.h>
@@ -418,11 +418,11 @@
   siginfo_t siginfo = {};
   // Mimic a trusted signal to allow tracing the process (see
   // ExceptionHandler::HandleSignal().
-  siginfo.si_code = SI_USER;
-  siginfo.si_pid = getpid();
-  struct ucontext context;
-  getcontext(&context);
-  return HandleSignal(sig, &siginfo, &context);
+//  siginfo.si_code = SI_USER;
+//  siginfo.si_pid = getpid();
+//  struct ucontext context;
+//  getcontext(&context);
+//  return HandleSignal(sig, &siginfo, &context);
 }
 
 // This function may run in a compromised context: see the top of the file.
@@ -567,7 +567,7 @@
   sys_prctl(PR_SET_DUMPABLE, 1);
 
   CrashContext context;
-  int getcontext_result = getcontext(&context.context);
+  int getcontext_result = 1;//getcontext(&context.context);
   if (getcontext_result)
     return false;
 #if !defined(__ARM_EABI__)
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h	Thu Feb 05 22:43:17 2015 +0100
@@ -192,7 +192,7 @@
     struct ucontext context;
 #if !defined(__ARM_EABI__)
     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-    struct _libc_fpstate float_state;
+    struct _fpstate float_state;
 #endif
   };
 
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc	Thu Feb 05 22:43:17 2015 +0100
@@ -174,7 +174,7 @@
 //   out: the minidump structure
 //   info: the collection of register structures.
 void CPUFillFromUContext(MDRawContextX86 *out, const ucontext *uc,
-                         const struct _libc_fpstate* fp) {
+                         const struct _fpstate* fp) {
   const greg_t* regs = uc->uc_mcontext.gregs;
 
   out->context_flags = MD_CONTEXT_X86_FULL |
@@ -274,7 +274,7 @@
 }
 
 void CPUFillFromUContext(MDRawContextAMD64 *out, const ucontext *uc,
-                         const struct _libc_fpstate* fpregs) {
+                         const struct _fpstate* fpregs) {
   const greg_t* regs = uc->uc_mcontext.gregs;
 
   out->context_flags = MD_CONTEXT_AMD64_FULL;
@@ -341,7 +341,7 @@
 }
 
 void CPUFillFromUContext(MDRawContextARM* out, const ucontext* uc,
-                         const struct _libc_fpstate* fpregs) {
+                         const struct _fpstate* fpregs) {
   out->context_flags = MD_CONTEXT_ARM_FULL;
 
   out->iregs[0] = uc->uc_mcontext.arm_r0;
@@ -1480,7 +1480,7 @@
   const char* path_;  // Path to the file where the minidum should be written.
 
   const struct ucontext* const ucontext_;  // also from the signal handler
-  const struct _libc_fpstate* const float_state_;  // ditto
+  const struct _fpstate* const float_state_;  // ditto
   LinuxDumper* dumper_;
   MinidumpFileWriter minidump_writer_;
   off_t minidump_size_limit_;
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h	Sun Feb 01 19:32:36 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
-
-#include <sys/cdefs.h>
-
-#ifdef __BIONIC_HAVE_STAB_H
-#include <stab.h>
-#else
-
-#ifdef __cplusplus
-extern "C" {
-#endif  // __cplusplus
-
-#define _STAB_CODE_LIST       \
-  _STAB_CODE_DEF(UNDF,0x00)   \
-  _STAB_CODE_DEF(GSYM,0x20)   \
-  _STAB_CODE_DEF(FNAME,0x22)  \
-  _STAB_CODE_DEF(FUN,0x24)    \
-  _STAB_CODE_DEF(STSYM,0x26)  \
-  _STAB_CODE_DEF(LCSYM,0x28)  \
-  _STAB_CODE_DEF(MAIN,0x2a)   \
-  _STAB_CODE_DEF(PC,0x30)     \
-  _STAB_CODE_DEF(NSYMS,0x32)  \
-  _STAB_CODE_DEF(NOMAP,0x34)  \
-  _STAB_CODE_DEF(OBJ,0x38)    \
-  _STAB_CODE_DEF(OPT,0x3c)    \
-  _STAB_CODE_DEF(RSYM,0x40)   \
-  _STAB_CODE_DEF(M2C,0x42)    \
-  _STAB_CODE_DEF(SLINE,0x44)  \
-  _STAB_CODE_DEF(DSLINE,0x46) \
-  _STAB_CODE_DEF(BSLINE,0x48) \
-  _STAB_CODE_DEF(BROWS,0x48)  \
-  _STAB_CODE_DEF(DEFD,0x4a)   \
-  _STAB_CODE_DEF(EHDECL,0x50) \
-  _STAB_CODE_DEF(MOD2,0x50)   \
-  _STAB_CODE_DEF(CATCH,0x54)  \
-  _STAB_CODE_DEF(SSYM,0x60)   \
-  _STAB_CODE_DEF(SO,0x64)     \
-  _STAB_CODE_DEF(LSYM,0x80)   \
-  _STAB_CODE_DEF(BINCL,0x82)  \
-  _STAB_CODE_DEF(SOL,0x84)    \
-  _STAB_CODE_DEF(PSYM,0xa0)   \
-  _STAB_CODE_DEF(EINCL,0xa2)  \
-  _STAB_CODE_DEF(ENTRY,0xa4)  \
-  _STAB_CODE_DEF(LBRAC,0xc0)  \
-  _STAB_CODE_DEF(EXCL,0xc2)   \
-  _STAB_CODE_DEF(SCOPE,0xc4)  \
-  _STAB_CODE_DEF(RBRAC,0xe0)  \
-  _STAB_CODE_DEF(BCOMM,0xe2)  \
-  _STAB_CODE_DEF(ECOMM,0xe4)  \
-  _STAB_CODE_DEF(ECOML,0xe8)  \
-  _STAB_CODE_DEF(NBTEXT,0xf0) \
-  _STAB_CODE_DEF(NBDATA,0xf2) \
-  _STAB_CODE_DEF(NBBSS,0xf4)  \
-  _STAB_CODE_DEF(NBSTS,0xf6)  \
-  _STAB_CODE_DEF(NBLCS,0xf8)  \
-  _STAB_CODE_DEF(LENG,0xfe)
-
-enum __stab_debug_code {
-#define _STAB_CODE_DEF(x,y)  N_##x = y,
-_STAB_CODE_LIST
-#undef _STAB_CODE_DEF
-};
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif  // __cplusplus
-
-#endif  // __BIONIC_HAVE_STAB_H
-
-#endif  // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h	Sun Feb 01 19:32:36 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
-
-#include <signal.h>
-
-#endif  // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Thu Feb 05 22:43:17 2015 +0100
@@ -829,9 +829,9 @@
 // last slash, or the whole filename if there are no slashes.
 string BaseFileName(const string &filename) {
   // Lots of copies!  basename's behavior is less than ideal.
-  char *c_filename = strdup(filename.c_str());
-  string base = basename(c_filename);
-  free(c_filename);
+  const char *c_filename = filename.c_str();
+  const char *p = strrchr(c_filename, '/');
+  string base = p ? p+1 : c_filename;
   return base;
 }
 
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h	Thu Feb 05 22:43:17 2015 +0100
@@ -36,6 +36,7 @@
 #include <elf.h>
 #include <link.h>
 #include <stddef.h>
+#include <sys/reg.h>
 
 #include "common/memory_range.h"
 
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc	Thu Feb 05 22:43:17 2015 +0100
@@ -34,7 +34,6 @@
 #include "common/stabs_reader.h"
 
 #include <assert.h>
-#include <stab.h>
 #include <string.h>
 
 #include <string>
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h	Thu Feb 05 22:43:17 2015 +0100
@@ -53,12 +53,19 @@
 #include <config.h>
 #endif
 
-#ifdef HAVE_A_OUT_H
-#include <a.out.h>
-#endif
 #ifdef HAVE_MACH_O_NLIST_H
 #include <mach-o/nlist.h>
 #endif
+// Definitions from <stab.h> and <a.out.h> for systems which
+// do not have them
+#undef N_UNDF
+#define N_UNDF 0x0
+#define N_FUN 0x24
+#define N_SLINE 0x44
+#define N_SO 0x64
+#define N_LSYM 0x80
+#define N_BINCL 0x82
+#define N_SOL 0x84
 
 #include <string>
 #include <vector>
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc	Thu Feb 05 22:43:17 2015 +0100
@@ -33,7 +33,6 @@
 
 #include <assert.h>
 #include <errno.h>
-#include <stab.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h	Thu Feb 05 22:43:17 2015 +0100
@@ -2814,7 +2814,7 @@
     LSS_INLINE _syscall6(void*, mmap,              void*, s,
                          size_t,                   l, int,               p,
                          int,                      f, int,               d,
-                         __off64_t,                o)
+                         off64_t,                o)
 
     LSS_INLINE _syscall4(int, newfstatat,         int,   d,
                          const char *,            p,
diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp	Sun Feb 01 19:32:36 2015 +0100
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp	Thu Feb 05 22:43:17 2015 +0100
@@ -49,6 +49,7 @@
 #elif defined(XP_LINUX)
 #include "nsIINIParser.h"
 #include "common/linux/linux_libc_support.h"
+#undef getdents64
 #include "third_party/lss/linux_syscall_support.h"
 #include "client/linux/crash_generation/client_info.h"
 #include "client/linux/crash_generation/crash_generation_server.h"