Summary: | llvm-libunwind does not provide an API useful in signal handler context | ||
---|---|---|---|
Product: | Base System | Reporter: | Matthias Andree <mandree> |
Component: | bin | Assignee: | freebsd-toolchain (Nobody) <toolchain> |
Status: | New --- | ||
Severity: | Affects Only Me | CC: | cem, dchagin, emaste, jbeich, pi |
Priority: | --- | Keywords: | patch |
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any | ||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242798 |
Description
Matthias Andree
2020-01-30 22:25:26 UTC
Yeah, our libunwind doesn't know how to backtrace out of a signal handler at this time. I have a WIP patch to unwind starting from a `ucontext`, which signal handlers created with sigaction(2) can access, but I haven't had time to work on it for a while; it would also require slightly different code in the signal handler. Here is the WIP: https://people.freebsd.org/~cem/libexecinfo.backtrace_ctx3.patch It works on amd64 (not tested recently) and maybe i386 (untested) and does not have support for other architectures. It is mostly missing tests, I think. Otherwise it just needs rebasing on the current tree, and eventually it will be nice to support non-x86 architectures. it would be nice to add something like https://reviews.llvm.org/rGc82deed6764cbc63966374baf9721331901ca958#change-9Mv5koDaVLbn |