This is essentially correct. You create the file descriptors using
that API, then there's a constructor for ExceptionHandler that accepts
a fd to communicate to the server.
> I have a few questions:
> - Is it expected that CrashGenerationServer is not in any library and
> you have to compile the file within your server application?
I hadn't noticed that. We could fix it to build as part of
libbreakpad_client.a, that wouldn't be hard.
> - Does the client have to be a child process of the server? If so what
> permissions etc are needed to make it work
Not really, but for practical reasons, yes. The only requirement is
that you pass the open file descriptor to the other process so it can
report back on it. There may be other ways of accomplishing this, but
I haven't looked into it. I have been investigating changing the way
Firefox's main process exception handling works, so that it would
spawn a helper process when crashes happen and then write the dump
from the other process, but I had to work around a few issues. You can
see my sample application here (working on Linux and OS X at the
moment):
http://hg.mozilla.org/users/tmielczarek_mozilla.com/breakpad-oop-test
That code relies on a couple of Breakpad patches that I haven't
bothered landing yet:
http://hg.mozilla.org/users/tmielczarek_mozilla.com/breakpad-mq/file/dfd8d050f0a3/no-close-on-exec
http://hg.mozilla.org/users/tmielczarek_mozilla.com/breakpad-mq/file/dfd8d050f0a3/crash-generation-server-port
> - Is this working for anyone outside google? Comments on the web
> suggest that it is heavily tailored to what chrome needs and may not
> yet be general purpose.
I think that Firefox may be the only consumer, actually. We're using
it for crash reporting for plugin processes (and content processes in
Firefox mobile). It's working fine for that purpose, but we do build
everything with our own build system, and we have lots of support
code. The code in the Breakpad repository was refactored from some
code in the Chromium repository, but I don't know that Chromium was
ever changed to use these classes.
-Ted
I plan on making this sample work on Windows when I have the time,
FWIW, even if it requires patching Breakpad (as I did for Linux and
Mac). That being said, I have no idea how much work it will be to
accomplish that at the moment.
If you can start the server first, then the code is much simpler. The
code was originally written to support Chrome, which is handling
crashes in a "main browser" process from its "renderer" processes. My
sample code flips the paradigm around, which makes it a bit more
involved.
-Ted