-
Notifications
You must be signed in to change notification settings - Fork 223
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
symbolizer: shell out to addr2line #5299
Conversation
I'm open to the idea of this though I would much rather actually fix the symbolizer, but I'd be ok with this being an escape hatch. It's definitely possible to write a correct symbolizer even with the bug in the delve code (we did in Polar Signals Colud but what we did doesn't work in a single-process context that we're constrained to in Parca). This being an escape hatch, I would prefer if we only implement support in Parca for this, but do not add llvm-addr2line or something like that to the container image, we would expect someone to add that themselves if they want to use this escape hatch until the symbolizer itself is fixed. |
Nice to read, I'll add a setting for this then and maybe some docs on how to use it if you face broken symbolization for your binary |
9d7df9d
to
12421f8
Compare
I've added a setting to enable this functionality by specifying a path to the |
Hi, kindly asking for another round of review here @brancz |
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.
Very nice! I think we're really close, sorry for missing this before. Happy new year!
8875c66
to
c0b5f8d
Compare
127dd5e
to
3325769
Compare
Hi, I used this MR locally for testing and found that there are still many issues?? The output of using addr2line-e libc.so.6 0xe7f9b is: |
@danipozo Do you have any constructive suggestions? Thank you |
And I followed the method in your MR: |
@chaochaoxiaochao can you add some more specific details about how you're using this and what issues you are finding? Along with proper formatting it would go a great length towards letting me understand your concerns.
In particular I don't follow what you're trying to say here since these two command invocations are the same. Thanks! |
Ah now I see in one you're using the |
As I mentioned earlier, I attempted to output the function name locally using the - fiC 0xce9db method, but the actual UI did not display it. The UI displayed ???? |
I tried to check the terminal but there were no error messages. I opened it at debug level. It's embarrassing that I couldn't compile parca locally. Otherwise, I could investigate the reason |
@danipozo The specific issue you mentioned earlier is actually that I can display the function name locally, but the UI shows that ?? |
And I roughly checked and found that libc.so.6 mostly has issues:?? |
@chaochaoxiaochao OK, I think I understand better now. To debug this in your specific case, you would need to:
Also please, can you try to stick to condensing the information in 1-2 messages in a row? This way it is much easier for me and probably for reviewers to follow, thanks! |
@danipozo Sorry, I'll streamline my response: Thank you for supporting and viewing |
@danipozo I tried to debug and compile libc locally before uploading debuginfo, but the result is still the same?? |
@chaochaoxiaochao I find it hard to keep debugging your use case, sorry. Please let's try to focus on code review here, I suggest that you open an issue to collect the details of your case and maybe find the cause at some point if/when this is used by more people or we find bugs that could be related. @brancz the latest commit (5775526) adds some error handling and a bigger buffer size to fix an edge case (~80 kiB of legitimate output for a single address) that I found for my binary. |
Adds symbolizer flag to specify addr2line binary to shell out to. Create a new liner type that uses said binary.
5775526
to
96a3933
Compare
If I understand correctly, we're saying that we're ok with not getting inlined frames? I think I'm generally ok with this since we'd like to ultimately just fix the symbolizer in the first place. |
Apologies (I accidentally misclicked and closed the PR but reopened immediately). |
No, actually the latest solution described in this comment lets us get inlined frames from
Misclicks happen :) |
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.
Ohhh awesome, I'm sorry I didn't understand before why that would work, but now makes sense!
Let's get this merged!
Great, thanks for taking the time to review! |
Of course, apologies it took so long, thank you very much for bearing with me! |
Use
addr2line
instead of custom addr2line implementation which doesn't symbolize addresses properly for some binaries (see #5291). Even with a fix for go-delve/delve#3861, which is the root cause of the failure in #5291, the current implementation can't symbolize ~50 % of the addresses in the stacks of the ClickHouse binary in my tests. Using gimli-rs/addr2line as theaddr2line
implementation works fast and well:Please take this PR as a rough proposal, there are of course details to be fleshed out: