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?

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Thomi
  • 11,159
  • 9
  • 67
  • 109
  • How cross platform should that be? gdb + coredump works nicely on x86, arm, ppc,... but needs the gcc toolchain. – stefaanv Sep 02 '09 at 11:27

3 Answers3

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.

Thomi
  • 11,159
  • 9
  • 67
  • 109
  • Hi, I can't seem to figure out how to build it. Any help would be appreciated - http://stackoverflow.com/questions/2925094/how-to-build-google-breakpad – Steve May 27 '10 at 21:29
  • 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: http://code.google.com/p/google-breakpad/wiki/GettingStartedWithBreakpad It is a really useful library though, and shipping with lots of production software, so it does the job quite well. – Ted Mielczarek Feb 24 '11 at 13:46
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

RED SOFT ADAIR
  • 11,294
  • 10
  • 48
  • 83
  • 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? – yatsek Apr 11 '14 at 12:57
  • Uh, I see it now (there are source codes with POSIX-compatible example) – yatsek Apr 11 '14 at 13:04
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?

D.Shawley
  • 54,743
  • 9
  • 91
  • 109