Hi Brock, On 03/01/19 07:58 AM, Brock York wrote: > I wrote a test program (attached) to learn how to use libunwind to > perform a backtrace from a sigsegv handler. > To test the segfault handler the segfault was caused by calling a bad > function pointer. > Because of this RBP hasn't been updated as there was no function > preamble to go to. > This seems to screw up the back trace which ends up missing the > function that called the bad function pointer as shown below in the > example output. > The attached patch does solve the problem for my test program but I'm > not sure on what weird edge cases I could be creating. > When running `make check` the test-ptrace test now fails on my > machine. So I'm looking for advice about whether this could be > feasible as a fix or not as I know it seems quite crazy.
I think the attached patch is probably ok. This codepath only happens after dwarf parsing fails, so any heuristic-rpb thing is ok here (it will only happen for backtrace()). Can you send a pull request to github? I have minor code review comments and it's easier to do there (and it runs the test suite). Thanks https://github.com/libunwind/libunwind/ _______________________________________________ Libunwind-devel mailing list Libunwind-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/libunwind-devel