bytehound icon indicating copy to clipboard operation
bytehound copied to clipboard

make shadow-stack based unwinding reusable for other projects?

Open milianw opened this issue 6 years ago • 2 comments

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.

milianw avatar May 20 '19 09:05 milianw

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.

koute avatar May 20 '19 11:05 koute

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.

milianw avatar May 20 '19 12:05 milianw