-Jim
Same here.
> Is there really no alternative? Conditional code in the sanitizers that figure things out? LLDB and GDB have a very similar sort of problem for backtraces, including when debug info isn’t available. How do they solve it?
The alternative is to use the unwind tables that both GCC and LLVM
generate even on C code, and that the ABI tells us to use, but their
argument is that's too slow. I don't know LLDB, but GDB uses tables,
but also the hidden logic (for faster unwinding), so I guess that with
code produced by LLVM, it just uses the tables.
GDB has a lot of hidden context with GCC that only works because their
development roadmaps are tied together and it's more scaring than
that, but I don't know how they chose to use magic or not.
The alternative is to use the unwind tables that both GCC and LLVM
generate even on C code, and that the ABI tells us to use, but their
argument is that's too slow. I don't know LLDB, but GDB uses tables,
but also the hidden logic (for faster unwinding), so I guess that with
code produced by LLVM, it just uses the tables.
It's not just sanitizers that need to be able to get fast, accurate stack traces. Consider sampling profilers that capture call stacks. Using the unwind tables is disruptively slow to the process under profile.Why not do the unwind table parsing after the fact? Especially for a profiler, there’s no reason to do that during the actual profile collection.