ruby/ruby — pull request #584 by csfrancis (2014-04-03 15:18:19+00:00)
Title: Libunwind support for Linux

@charliesome /cc: @Sirupsen, @camilo, @arthurnn

This adds a few things:

- Support for libunwind on Linux. There's no need to `#undef backtrace` on Linux because libunwind's global `backtrace` symbol will take precedence over glibc.
- If `USE_BACKTRACE_SYMBOLS_FD` is defined, MRI will use `backtrace_symbols_fd` rather than `backtrace_symbols` or `rb_dump_backtrace_with_lines`, which are both potentially unsafe when being called from a signal handler. The latter methods also allocate memory from the heap, which can also be unsafe in that context.
- Dump machine registers on x64. In cases where core dumps are not being generated, it's still useful to know register contents.