gohome1984 / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

OS X exception handler / minidump generator should set exception address correctly for EXC_BAD_ACCESS #323

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On OS X, currently the minidump generator sets the
MDException.exception_address to the PC of the faulting thread. For
EXC_BAD_ACCESS, the memory address that caused the exception is available
as the subcode (and a comment on this field even mentions it):
http://code.google.com/p/google-breakpad/source/browse/trunk/src/google_breakpad
/common/minidump_format.h#504

On Windows, MinidumpWriteDump handles this correctly, and it's useful
information. It can tell you if a crash looks exploitable or not
(deferencing NULL vs. an arbitrary memory address).

I think getting this data is simply a matter of getting receieve.code[1] here:
http://code.google.com/p/google-breakpad/source/browse/trunk/src/client/mac/hand
ler/exception_handler.cc#510
when receive.exception == EXC_BAD_ACCESS (and we can sanity check that
receive.code_count > 1), and then persisting that value to use it here:
http://code.google.com/p/google-breakpad/source/browse/trunk/src/client/mac/hand
ler/minidump_generator.cc#597

Original issue reported on code.google.com by ted.mielczarek on 12 Jun 2009 at 11:19

GoogleCodeExporter commented 9 years ago
Here's a patch. I changed the Inspector code, although I don't really know how 
to
test that properly. Everything compiles, anyway, and looks sane. I modified
|handler_test| to crash accessing a non-NULL pointer, and the pointer address is
correctly listed as the crash address in the minidump.

Original comment by ted.mielczarek on 12 Jun 2009 at 12:35

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r350

Original comment by ted.mielczarek on 12 Jun 2009 at 8:37