Skip to content
forked from ribtoks/chillout

Simple cross-platform crash handling library for desktop native apps

License

Notifications You must be signed in to change notification settings

Artiom-M/chillout

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chillout

Build status Build Status Codacy Badge

os windows os mac os linux

license copyright language c++

Chillout is a simple cross-platform crash handling library.

This library can be used on Windows, OS X and Linux to catch various unhandled exceptions (access violation, signals, alloc errors etc.), generate backtraces for logs and possibly crash dump (the latter currently only for Windows).

The API is very simple - you provide your callbacks for crash and/or backtracing. Chillout makes sure your handlers will be executed in the event of a crash.

Basic usage

auto &chillout = Debug::Chillout::getInstance();
// install various crash handlers
chillout.init("my_app_name", "/path/to/crash/or/backtraces/dir");

chillout.setBacktraceCallback([](const char * const stackEntry) {
    fprintf(stderr, "my trace:  %s", stackEntry);
});

chillout.setCrashCallback([&chillout]() {
    chillout.backtrace();
    chillout.createCrashDump();
});

Disclaimer

Yes, Breakpad Crashpad exists, but sometimes it is too big or too complicated to setup (e.g. for small project). This library is definitely less reliable and featured than age-tested Breakpad/Crashpad, but it is simple, small and covered by tests.

Limitations

  • Linux/Mac - no core dumps and any other type of crash dumps
  • stacktrace only of the thread which crashed

References

This project won't be possible without:

  • CrashRpt - most full collection of information about Windows crash handlers
  • DeathHandler - ideas to preallocate buffer in case of broken heap on 'nix systems
  • gist by @fmela - idea to use dladdr() instead of parsing raw/mangled line myself
  • stacktrace in Chromium - just useful information how demangling works in Chromium

About

Simple cross-platform crash handling library for desktop native apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 97.3%
  • CMake 2.1%
  • QMake 0.6%