-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heap buffer overflow in libdwarf on assertion failed in sanitizer build #123
Comments
Hi, thanks for the report. I’ll look into this later today. |
Leaking the sanitizer flags to libdwarf is ok, it is often helpful to compile an entire project (including libraries) with sanitizers. I'm glad you're able to work around this so you could unblock. In general any sanitizer issue is a bug (false positives are pretty rare) so I am definitely interested in tracking this issue down. Looking into this, the error is really odd. It would be really helpful to get some additional information here about what compiler you're using and how you're compiling. Ideally I'd like to be able to reproduce this but that can sometimes be hard. If you are able to send the compiled program where this was failing that could be helpful for diagnosing what's going on with libdwarf and cpptrace here. |
The author of libdwarf got back to me and clarified the handling. I'm surprised by the behavior and why this seems to only cause problems under very special circumstances 😄 I'll fix this in cpptrace and do patch releases of both cpptrace and libassert in the coming days. |
To work around this in the meantime, for you or anyone else using cpptrace, it should be easy by setting |
Hey thanks a lot for the quick investigation and fix! I will try it next time I have time to pour into integrating libassert (I am unsure when that will be). For information & reference, the reason I did not post my code was to spare you a complex project if I could get a simpler showcase to fail (which I couldn't), but our work is in the open: Here is where I disabled stacktrace printing to avoid the segfault |
Hi and thanks for this awesome lib!
I encountered a crash on my project when trying to use libassert with sanitizers enabled:
It looks like it was caused by my (mis)usage of
add_compile_options
andadd_link_options
in myCmakeLists.txt
to add-fsanitize=
which probably leaked the flags to libdwarf.I was not able to reproduce with a smaller project. All I got were link errors about various symbols from ASan not being found by libdwarf. This led me to solve the issue by replacing
add_{compile,link}_options
withtarget_{compile,link}_options
.It's not really an issue of libaddress, but is/was a blocker to using it, so I'm putting it here in case it helps someone else 🤷
The text was updated successfully, but these errors were encountered: