breakpad/src/google_breakpad/processor
Leonard Mosescu 01431c2f61 Handle very large stack traces
The main motivation for this change is to handle very large stack
traces, normally the result of infinite recursion. This part is
actually fairly simple, relaxing a few self-imposed limits on how
many frames we can unwind and the max size for stack memory.

Relaxing these limits requires stricter and more consistent checks for
stack unwinding. There are a number of unwinding invariants that apply
to all the platforms:

1. stack pointer (and frame pointer) must be within the stack memory
   (frame pointer, if preset, must point to the right frame too)
2. unwinding must monotonically increase SP
   (except for the first frame unwind, this must be a strict increase)
3. Instruction pointer (return address) must point to a valid location
4. stack pointer (and frame pointer) must be appropriately aligned

This change is focused on 2), which is enough to guarantee that the
unwinding doesn't get stuck in an infinite loop.

1) is implicitly validated part of accessing the stack memory
   (explicit checks might be nice though).
4) is ABI specific and while it may be valuable in catching suspicious
   frames is not in the scope of this change.
3) is also an interesting check but thanks to just-in-time compilation
   it's more complex than just calling 
   StackWalker::InstructionAddressSeemsValid() 
   and we don't want to drop parts of the callstack due to an overly
   conservative check.

Bug: chromium:735989

Change-Id: I9aaba77c7fd028942d77c87d51b5e6f94e136ddd
Reviewed-on: https://chromium-review.googlesource.com/563771
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
2017-07-12 17:53:15 +00:00
..
basic_source_line_resolver.h Adding stricter validation checks to various symbol parser functions. 2013-09-25 18:25:13 +00:00
call_stack.h Add a missing const to an accessor. 2016-04-14 14:45:04 -04:00
code_module.h Populate stack frames with unloaded module info. 2017-01-19 19:33:56 +00:00
code_modules.h Server-side workaround to handle overlapping modules. 2016-06-20 11:14:47 -07:00
dump_context.h Use general instruction/stack pointer convenience method instead of manually 2015-06-30 23:22:09 +00:00
dump_object.h Refactoring in preparation for microdump processing 2014-09-08 19:10:42 +00:00
exploitability.h Add check for Linux minidump ending on bad write for exploitability rating. 2015-08-21 16:22:19 +00:00
fast_source_line_resolver.h Detect corrupt symbol files during minidump processing. Recover from the errors and use the good data if possible. 2013-07-11 01:36:06 +00:00
memory_region.h Refactoring in preparation for microdump processing 2014-09-08 19:10:42 +00:00
microdump_processor.h Microdump processing implementation 2014-11-19 21:33:26 +00:00
microdump.h Server-side workaround to handle overlapping modules. 2016-06-20 11:14:47 -07:00
minidump_processor.h Add check for Linux minidump ending on bad write for exploitability rating. 2015-08-21 16:22:19 +00:00
minidump.h Handle very large stack traces 2017-07-12 17:53:15 +00:00
proc_maps_linux.h Allow compiling the google-breakpad code using a global ::string class instead of std::string. 2016-11-08 01:29:06 +00:00
process_result.h Refactoring in preparation for microdump processing 2014-09-08 19:10:42 +00:00
process_state.h Populate stack frames with unloaded module info. 2017-01-19 19:33:56 +00:00
source_line_resolver_base.h Detect corrupt symbol files during minidump processing. Recover from the errors and use the good data if possible. 2013-07-11 01:36:06 +00:00
source_line_resolver_interface.h Detect corrupt symbol files during minidump processing. Recover from the errors and use the good data if possible. 2013-07-11 01:36:06 +00:00
stack_frame_cpu.h Process minidumps generated on ARM64 in iOS apps. 2013-11-23 01:45:20 +00:00
stack_frame_symbolizer.h Populate stack frames with unloaded module info. 2017-01-19 19:33:56 +00:00
stack_frame.h Create StackFrame::FRAME_TRUST_PREWALKED trust type. 2013-08-23 19:41:36 +00:00
stackwalker.h Handle very large stack traces 2017-07-12 17:53:15 +00:00
symbol_supplier.h Detect corrupt symbol files during minidump processing. Recover from the errors and use the good data if possible. 2013-07-11 01:36:06 +00:00
system_info.h Parse additional line introduced in the microdump format and containing the GPU infromation in the following format: 2016-02-11 10:04:04 -08:00