-
Notifications
You must be signed in to change notification settings - Fork 712
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
Fix tail call optimisation in C++ backtrace capture #468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great! But I would make sure that this attribute is not ignored and the frames really remain.
4aa53b8
to
7f35718
Compare
fwiw, |
The question is which of these codes is more portable across different compilers? |
definitely the attribute if it works.
Hard to say really. I'd expect an attribute like that to be my first choice, but the code I shared is what I found Apple does/was-doing in CF. |
dd735d7
to
e268806
Compare
I really like the idea with |
Tested this PR:
See that after the fix there's an extra frame in the stacktrace. |
Did the frame always get deleted before this fix? |
Yes (with Release build) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you very much!
According to documentation there's a
__attribute__((disable_tail_calls))
attribute that should work fine for our case where we need to make sure the stacktrace has predictable number of calls at the top.