-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Linux C++ crashpad stacktrace incorrect #569
Comments
The frames from libc/libstdc++ are a bit weird, but its unwinding correctly. I wonder if all the calls are being optimized away, or what exactly is going on. Here the function has a broken name, but the file/line information is correct. Also note that all of these are inline frames. In your case specifically, I think you are missing some unwind information (indicated by the red underline). Can you provide a link to your sentry issue so that I can look at the debug files in detail? |
Thanks for responding. Here is the link to the issue: This indicate that all the required information is available, including stack unwinding info. The stack unwinding info is ticked green when I uploaded executable along with the debug file. Some aspects
Uploaded debug file
There are no per thread stack frames displayed. All are shown in a single frame. Considering that gdb displays correctly, I assume that the necessary debug information is correctly generated. Much of sentry documentation is common across all platforms, but there may be subtle Linux issues I might have missed. |
I would guess that the compiler can completely inline
That is perfectly fine, also the way you generate the debug file.
gdb has access to all files on the system, and sentry does not. In particular, you are missing all the system libraries like libc, libpthread, etc. (and also We have no builtin symbol sources for well known linux distributions, like we have for apple or microsoft. So you will have to upload all of your system symbols manually. With that, you should get good stack traces. |
It is understandable system and sentry libraries not displaying symbols, however, this doesn't seem to be the issue.
Is it reasonable to expect stack trace similar to gdb for the part of the code that has debug information files available? If not, what other files one needs to add to help sentry?
How to avoid |
Another thing I noticed is that the function argument values do not show up. Is there some sentry magic that can accomplish this? |
Not currently, that would be a fairly big change, and so far we have not scheduled it. |
Getting back to this after results from a real world example this time: We have a code (from a very complex project). with steps executed in this sequence
(2) is immediately followed by (3) I have used libunwind to get stack trace and compare with sentry's stack trace at around the same point. When I see stacktrace leading to handleControllerUpdate, it looks different for sentry stacktrace and libunwind. The issue is here: https://sentry.io/organizations/colet-systems/issues/2532311290/?project=5868275&query=is%3Aunresolved Happy to fill you in with details if I am not very clear. |
The problem here is that you haven’t uploaded all the debug/executable files. |
That makes sense but please clarify these points. Thanks. Suppose we have an application 'A' with system libraries 'S' linked (libc etc). Let 'A' has debug information file (DIF) uploaded. I expected part of the stack trace that features 'A' (i.e. excluding 'S' like libc) would
What exactly does this mean? This means stacktrace can be buggy and correct functions are not identified? Any suggestions on what we can do? |
Yes, you do need proper unwind info for both A, and S. Also note that sometimes For your specific usecase above, the topmost frame is from
It means that it simply scans stack memory and flags anything as a stack frame that happens to point into a valid code region. So it can have a ton of false positives, and also missing correct functions if it then uses the unwind info of the incorrectly identified function address. I hope this helps. I will close this issue, as the underlying problem seems to be missing unwind info. |
I am getting incorrect stack traces for the following code. The curious thing is presence of this unused function: uncommenting_this_functions_scuppers_stackrace_for_release_builds
(obviously christened for this example.).
If this is present, wrong stack trace. If absent, somewhat better stack trace. In the incorrect one, function names are not coming out correctly.
We have a much larger Linux C++ projects where stack traces are jumbled up and trying to narrow down the problem with a toy example like this.
(also posted in sentry forums earlier. Apologies if that breaks post etiquette. I wanted better visibility)
When does the problem happen
Environment
Steps To Reproduce
Source code:
sentry_example_crashpad_docker.cpp.txt
Log output
The call sequence leading to crash should be : main → SetupSentry::SetupSentry → trigger_crash_a → trigger_crash_b → trigger_crash
See snapshot of stacktrace screens:
Stacktrace ok
Stacktrace incorrect (trigger_crash_a function call missing. We see 'clone .constprop.0' in its place). Happens when uncommenting_this_functions_scuppers_stackrace_for_release_builds is uncomented.
Output of crash and crashpad upload (identical log for run in both cases):
upload_log_for_ok_stacktrace.txt
upload_log_for_not_ok_stacktrace.txt
The text was updated successfully, but these errors were encountered: