Too Long; Tell Me The Downsides First
Sure, here you go!
-
This covers Windows only. The principles map on to Linux, but the code sample doesn't!
-
Spoilers for the rest of the post, if that's the sort of thing you care about --
Disadvantages to having your crash handler be a side-path of your main program's EXE:
- Missing DLLs. They couldn't possibly be caught by this setup -- the crash handler process can't launch if it's the same process that's missing DLLs!
- Static initializers. If you have a very C++-y program with a bunch of global variables with constructors that can crash, then you can launch the process, but you can't safely enter
main()!
- Addressing these disadvantages is covered in the article: build the crash hander as a separate EXE.
Okay, on with the full post.
The unexamined app is not worth shipping
As a Windows app developer, you will eventually want to write a crash reporter, so that you can fix bugs i


