-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Problem: no backtrace is printed on assert #1966
Conversation
@bluca |
Yes, but requires a bit more work since there's nothing using pkg-config in cmake as far as I could see, so I wanted to get autotools in shape first |
Also I'm not sure if libunwind can work on windows, so it's in the not-windows ifdef section of zmq_abort |
Solution: add an optional dependency on libunwind, and if present use it to print the backtrace when zmq_abort is called.
Solution: clean up and remove it
@bluca thanks!!! |
No problem! Will send the CMake part as soon as I have time to look into it |
@bluca Didn't get a chance to reply, but thanks! 👍 |
Cool stuff. I had looked at doing this a while ago, but got discouraged by libunwind not being ubiquitous/portable. Making it an optional dep and falling back to the old behaviour is the perfect solution! |
(About libunwind functionality on windows) Visual Studio's extensive debugging environment allows stack tracing without third party libraries. There is no need to add any such dependencies for windows. |
@bluca -
|
Solution: add an optional dependency on libunwind, and if present
use it to print the backtrace when zmq_abort is called.
Fixes #1965
I made the output similar to GDB's backtrace. Example:
Note that it's enabled by default if libunwind is found. I don't think this is a problem, since if the application linking to the library doesn't have debugging symbols, there is no useful output: