Upload_transparent

Crash N' Burn: Writing Linux application fault handlers

 
 
 
 
 
tuxolgy

by tuxolgy

Value This
Doc
Scribd
Average
     
Pages: 25 43
Words: 1037 13640
Characters: 6577 81678
Lines: 276 623
     
     
Letters per word: 6.34 5.99
Words per line: 3.76 21.89
Words per page: 41.48 317.21

Add to your reading list

Flag_red Flag this document

Document Information

4,598 Reads | 0 Comments

Description

Crash and burn: writing Linux application fault handlers

Complementing the standard Linux fault handler ("Segmentation fault. Core dumped.") with a custom handler that reports the crashing program state without a debugger is a useful endeavor in many situations. Unfortunately, writing such a fault handler correctly can be surprisingly hard and requires certain amount of black magic.

In this tutorial we will demonstrate how to write such a handler, covering such topics as: getting program symbolic stack trace and registers and reporting them safely, the care and feeding of async signal POSIX handler functions, how to avoid implicit memory allocations and how to test for them, how to handle multi-threaded faults, the black magic involved with how Linux handles signal handlers, the unfortunate effect this has on obtaining a correct stack trace in case of a fault and how to overcome this limitation.

Openoffice_16x16 25 Pages


Date Added

06/30/2008

Category

Uncategorized.

Tags
Groups
Copyright

Attribution Non-commercial

More info »