Gracefully handling process crashes

A bug in the application that caused a crash at runtime? My God, how is this possible?

Unfortunately, to the well-heeled software veteran, though, this is not a big surprise. Bugs exist; they can hide really well, for years, sometimes; one day, they come out and—bang!the process crashes.

Here, our intention is not to discuss debugging techniques or tools (let's save that for another book perhaps, shall we?); instead, it's this key point: if our application process does crash, can we do something? Certainly: in the previous chapter, we have learned in detail how we can trap signals. Why not design our application such that we trap the typical fatal signals—the SIGBUS, SIGFPE, SIGILL, and SIGSEGV—and, ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.