make shadow-stack based unwinding reusable for other projects?
Hey there,
super cool project! I wonder, would it be possible to make your shadow-stack based unwinding trick reusable for other projects? It would definitely benefit me in heaptrack, and I bet it would benefit others too.
Certainly!
It should be relatively straightforward to make a library with a replacement for _Unwind_Backtrace. Basically, you'd just take the code from preload/src/unwind.rs, modify it a little, wrap it in a C API, put it inside of a cdylib crate (it'd probably be the best to put it in the not-perf repo), and you'd have an .so which is callable from any language.
I have zero rust experience, but if you have a C API I can play with, I'd like to test it out.
I suggest you don't shadow existing API though, better use different names. If anyone wants to replace _Unwind_Backtrace they should do that themselves.