Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(154)

Issue 200001: Write a memory around the instruction pointer from the crashing thread to the minidump on OS X (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by Ted Mielczarek
Modified:
14 years, 2 months ago
Reviewers:
mochalatte
CC:
google-breakpad-dev_googlegroups.com
Visibility:
Public.

Description

On Windows, MinidumpWriteDump includes a window of memory around
the instruction pointer from the crashing thread in the minidump,
which can be useful for debugging JIT crashes. This patch implements
the same behavior for the OS X minidump generator.

The patch includes some build shuffling to include a few processor
source files in the unittest build, as well as moving
src/common/linux/{memory.h,memory_unittest.cc} to src/common, with
some slight changes so memory.h is usable on OS X. I also hooked up
the memory_unittest tests that weren't being run anywhere.

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M Makefile.am View 1 chunk +1 line, -0 lines 0 comments Download
M Makefile.in View 6 chunks +22 lines, -0 lines 0 comments Download
M src/client/linux/handler/exception_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/client/linux/minidump_writer/linux_dumper.h View 1 chunk +1 line, -1 line 0 comments Download
M src/client/linux/minidump_writer/linux_dumper_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/client/mac/Breakpad.xcodeproj/project.pbxproj View 7 chunks +30 lines, -0 lines 0 comments Download
M src/client/mac/handler/minidump_generator.cc View 5 chunks +119 lines, -2 lines 3 comments Download
M src/client/mac/handler/minidump_generator.h View 3 chunks +12 lines, -1 line 0 comments Download
M src/client/mac/tests/exception_handler_test.cc View 4 chunks +127 lines, -3 lines 0 comments Download
A src/client/mac/tests/testlogging.h View 1 chunk +9 lines, -0 lines 0 comments Download
M src/common/memory.h View 2 chunks +10 lines, -3 lines 0 comments Download
M src/common/memory_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 3
Ted Mielczarek
14 years, 2 months ago #1
mochalatte
LGTM http://breakpad.appspot.com/200001/diff/1/8 File src/client/mac/handler/minidump_generator.cc (right): http://breakpad.appspot.com/200001/diff/1/8#newcode581 Line 581: const size_t kIPMemorySize = 256; could you ...
14 years, 2 months ago #2
Ted Mielczarek
14 years, 2 months ago #3
http://breakpad.appspot.com/200001/diff/1/8
File src/client/mac/handler/minidump_generator.cc (right):

http://breakpad.appspot.com/200001/diff/1/8#newcode615
Line 615: uintptr_t(ip - (kIPMemorySize / 2)));
On 2010/09/22 20:24:26, mochalatte wrote:
> i might be a little hazy on the details of mach_vm_region_Recurse but do you
> want max or min here - shouldn't the lower bound be the {start of
> region|ip-128}, depending on which is closest to the faulting address?

Oops, good catch. I added tests to check that we bound the memory appropriately.

> also, what does mach_vm_region_recurse return if the IP is not part of any
> memory region? could it return the memory region that is valid and "above" the
> IP? (again stressing that it's been awhile since I touched this stuff)

Also good, I added a test for this as well (made the instruction pointer NULL,
ensured that a memory region didn't get added to the dump).

Now of course I'm going to have to go back and write those tests for Linux to
make sure that code works too.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted