Dump stack traces on assertion, crash, or general trouble

It's so easy to dump stack traces these days!

I have a "backtrace" branch right now that an dump stack traces on assertion failures. It works on glibc/ELF, and on OSX. We should expand it to work on Windows too, and BSD if we can.

Other fixes to make before it's ready:

  • It should be able to log a stack trace too.
    • It should log the stack trace on an assertion.
  • There should be an option to tell it not to log to the stack_dumps file, perhaps.
  • Perhaps the logfile should be pid-controlled?
  • It should support Windows.
  • It should handle deadly signals (SEGV, etc) as well.
  • It should indicate to the user somehow (if it can) that stuff might be saved to the stack_dumps file.
  • It should have tests.