HomeFreeBSD

libspl/backtrace: comment and harden libunwind backtracer

Description

libspl/backtrace: comment and harden libunwind backtracer

This is the sort of code that we get right once and never look at again.
Anyone reading this code is already likely in the middle of a debugging
nightmare, and then they have a wall of manual string construction and
an unfamiliar and idiosyncratic library to deal with. So, comment the
whole thing to try to make it clear what's going on.

In pursuit of the above, I've added return checks to some of the
libunwind calls, fixed the frame loop to not skip the "top" frame
(however unseful it may be), and fix a couple of calls to
spl_bt_u64_to_hex_str() which requested 18 digits instead of 16.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16653

Details

Provenance
rob.norris_klarasystems.comAuthored on Oct 18 2024, 4:10 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 20 2024, 4:36 PM
Parents
rG2596a7530698: libspl/backtrace: rename and document hex conversion function
Branches
Unknown
Tags
Unknown