Cross-platform crash handler
Asked Answered
Y

3

15

I'm looking for a cross-platform crash handler. Google Breakpad looks promising, but it is sorely lacking any documentation, and requires a reasonable amount of fiddling to actually get going.

What is a better alternative?

All I need is the ability to reliably record crash dumps, stack traces, and CPU information at the time of a crash. Alternatively, what is the experience using Google Breakpad? Has it been great or horrible?

Yellows answered 2/9, 2009 at 11:23 Comment(1)
How cross platform should that be? gdb + coredump works nicely on x86, arm, ppc,... but needs the gcc toolchain.Ingenerate
Y
7

Well, it turns out that google-breakpad is pretty nice after all. It's not totally easy to set up, but it's OK for what I need.

Yellows answered 6/9, 2009 at 9:44 Comment(2)
Hi, I can't seem to figure out how to build it. Any help would be appreciated - #2925594Hewes
The documentation isn't great, I'll admit. I've been trying to improve that, and I think it's a little better now, see: code.google.com/p/google-breakpad/wiki/… It is a really useful library though, and shipping with lots of production software, so it does the job quite well.Forsaken
F
6

I wrote a article about dumping the stack in C/C++ with Windows and Unix/Linux at DDJ some years ago. It does not use a coredump, but it writes stack frames into a log file, on internal errors, or when the OS determines a Application fault.

Maybe it helps you:

See http://www.ddj.com/architect/185300443

Fabaceous answered 2/9, 2009 at 11:26 Comment(2)
I know that it's old but I can't see Unix/Linux version in the article. Is there some sort of follow-up somwhere?Klee
Uh, I see it now (there are source codes with POSIX-compatible example)Klee
A
3

For compiled code, there are two good options - core dumps under UNIX variants and Dr. Watson crash logs/dumps under Windows. I know that this isn't a cross-platform solution, but when if you are only dealing with two platforms, then having two solutions isn't really that bad of a thing.

Of course, the solutions only capture a core image at the time of crash and not the state of the machine. I don't know of anything that will capture IO and CPU load at the time of an application crash. You might want to look into the Mozilla Crash Reporter which is, oddly enough, also known as "Breakpad"... coincidence?

Amathiste answered 2/9, 2009 at 11:47 Comment(1)
no, it's not a coincidence - mozilla uses google breakpad as it's crash handler.Yellows

© 2022 - 2024 — McMap. All rights reserved.