breakpad/src/client
Primiano Tucci 4d06db5a1f Linux ExceptionHandler: don't allocate the CrashContext on the stack
On Android the size of the alternate stack can be very small (8k).
Even if breakpad uses sigaltstack to increase the size of the alternate
stack during initialization, that call affects only the main thread.
On Android, the libc's pthread initializer reset the sigaltstack to 8k.
When entering a signal handler, the kernel typically pushes the context
on the alternate stack. On arm64, sizeof(CrashContext) is ~5k, which
leaves 3k of usable stack for breakpad.
On top of that, breakpad allocates another struct CrashContext on the
stack. In the case of Android arm64, then, breakpad ends up using
5k + 5k > 8k of stack, which causes a stack overflow.
This got unnoticed in Android L, as the alternate stack didn't have
red-zones between them, so breakpad was often happily overflowing onto
the next thread's stack. This is not the case anymore [1].
This CL moves the CrashContext into a global variable. It should be
safe as the ExceptionHandlers are serialized on a mutex.

[1] 595752f623

BUG=374
R=mark@chromium.org

Review URL: https://codereview.chromium.org/1354923002 .
2015-09-22 09:11:24 +01:00
..
apple/Framework Mac: Add support for in-process crash reporting to Breakpad. 2014-09-15 22:48:18 +00:00
ios Default nil or empty version string to CFBundleVersion 2015-07-10 01:29:50 +00:00
linux Linux ExceptionHandler: don't allocate the CrashContext on the stack 2015-09-22 09:11:24 +01:00
mac tests: InstructionPointerMemoryNullPointer: make it work under llvm 2015-07-20 06:19:49 +00:00
solaris/handler Use stdint types everywhere 2013-03-06 14:04:42 +00:00
windows Fix -Wreorder warnings in the Windows code. 2015-07-10 20:24:33 +00:00
minidump_file_writer-inl.h Clean up build for 64 bit. 2010-07-19 20:43:49 +00:00
minidump_file_writer.cc Update GTM and enable -Wundef and strict C++11 flags. 2014-02-26 16:14:04 +00:00
minidump_file_writer.h Fix the documentation for MinidumpFileWriter::Open(). 2014-05-12 19:36:46 +00:00
minidump_file_writer_unittest.cc Turn on more warnings in ios / mac projects. 2012-09-21 07:58:25 +00:00