Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Drop-in crash handler for POSIX

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Doxyfile
Octocat-spinner-32 README
Octocat-spinner-32 airbag_fd.c
Octocat-spinner-32 airbag_fd.h
Octocat-spinner-32 airbag_fd.h.3
Octocat-spinner-32 airbag_fd_test.c
Octocat-spinner-32 airbag_fd_test.sh
README
airbag_fd

Drop-in crash handlers for POSIX, particularly embedded Linux.
Copyright 2011 Chuck Coffing <clc@alum.mit.edu>, MIT licensed
https://github.com/ccoffing/airbag_fd

Dumps registers, backtrace, and instruction stream to a file descriptor.
Intended to be self-contained and resilient.  Where possible, will detect and
intelligently handle corrupt state, such as jumping through a bad pointer or a
blown stack.  The harvesting and reporting of the crash log is left as an
exercise for the reader.

Quick start:

1. Include airbag_fd.c and airbag_fd.h in your project.
2. If it doesn't build, define the appropriate DISABLE_* flag(s).
3. Call one of the airbag_init_* functions early.
4. Post-crash (perhaps in a watchdog or on next startup) harvest crash logs.

Example test:

$ g++ -Os -Wall -Wextra -ldl airbag_fd.c airbag_fd_test.c -o airbag_fd_test
$ ./airbag_fd_test.sh


Notes:

x86:

x86_64:
No heuristics for trashed stack.

mips:

arm:
Optionally build your application with -mpoke-function-name.
Something went wrong with that request. Please try again.