Out of process dump on Linux

685 views
Skip to first unread message

31 30

unread,
Mar 25, 2010, 8:33:33 PM3/25/10
to google-breakpad-discuss
Has any thought been given to generating an dump out-of-process on
Linux ?

I'm thinking here specifically of hooking into /proc/sys/kernel/
core_pattern and using an out-of-process mechanism. I think this would
have the following benefits:

a. Less restrictive environment wrt what might/might not be broken.
b. Potentially no need to link executables against a client library.

Earl

Ted Mielczarek

unread,
Mar 26, 2010, 6:45:31 AM3/26/10
to google-brea...@googlegroups.com
We have the opposite tool, a "minidump2core" program:
http://code.google.com/p/google-breakpad/source/browse/trunk/src/tools/linux/md2core/minidump-2-core.cc

The Linux client code supports out-of-process dump generation, but it assumes collaboration from the process being dumped. In the parent process, you instantiate a CrashGenerationServer, giving it one end of a socketpair (created using the static CrashGenerationServer::CreateReportChannel function):
http://code.google.com/p/google-breakpad/source/browse/trunk/src/client/linux/crash_generation/crash_generation_server.h

Then in the child process, you instantiate an ExceptionHandler, but use the constructor that takes a server_fd, which is the other end of the socketpair you previously created:
http://code.google.com/p/google-breakpad/source/browse/trunk/src/client/linux/handler/exception_handler.h#127

Then, when the exception handler is triggered in the child, it will signal the parent using the socket and the parent will write the actual minidump.

As you can tell, this was primarily architected to support Chrome's multiprocess model, so YMMV. I don't think Breakpad was ever intended to be a system-wide handler of crashes, but rather a library that a particular application would integrate to provide crash reporting.

-Ted

31 30

unread,
Mar 26, 2010, 12:03:43 PM3/26/10
to google-breakpad-discuss
On Mar 26, 3:45 am, Ted Mielczarek <ted.mielcza...@gmail.com> wrote:
> The Linux client code supports out-of-process dump generation, but it
> assumes collaboration from the process being dumped. In the parent process,
> you instantiate a CrashGenerationServer, giving it one end of a socketpair
> (created using the static CrashGenerationServer::CreateReportChannel
> function):http://code.google.com/p/google-breakpad/source/browse/trunk/src/clie...

I see. If the kernel is prepared to feed the dump server a core file
via core_pattern,
does the existing WriteMiniDump code have the right mechanisms to walk
the core
file provided by the kernel and convert it a minidump ?

Ted Mielczarek

unread,
Mar 26, 2010, 1:06:46 PM3/26/10
to google-brea...@googlegroups.com
On Fri, Mar 26, 2010 at 12:03 PM, 31 30 <31...@mail.com> wrote:
I see.  If the kernel is prepared to feed the dump server a core file
via core_pattern,
does the existing WriteMiniDump code have the right mechanisms to walk
the core
file provided by the kernel and convert it a minidump ?


No, I don't believe so. The existing WriteMinidump code uses ptrace to attach to the child process and read the relevant information out of it. I'm fairly certain it doesn't have any code for reading core files.

-Ted

Reply all
Reply to author
Forward
0 new messages