Skip to content
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

Server side symbolication for panics #354

Closed
zumoshi opened this issue Aug 4, 2021 · 4 comments
Closed

Server side symbolication for panics #354

zumoshi opened this issue Aug 4, 2021 · 4 comments

Comments

@zumoshi
Copy link

zumoshi commented Aug 4, 2021

Hello,
Panic reports sent to sentry for programs compiled on release profile is missing stacktrace information.
From uploaded json:

{"function":"main","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x7ff7aad52967"}

Which is expected but it is also missing debug_id (which the Native SDK sends). So I don't see how I can get it to use the server-side symbolicator.

For comparison a Native crash (i.e. segfault) on my rust program (also built in release mode) sends this:

{"code_id":"610a421b7a4000","code_file":"C:\\tmp\\code\\target\\release\\crashtest.exe","debug_id":"66446db3-ab4e-4dae-91fd-1ddfd42eed3d-1","debug_file":"C:\\tmp\\code\\target\\release\\crashtest.pdb","arch":"x86_64","image_addr":"0x7ff764520000","image_size":8011776,"candidates":[{"download":{"status":"notfound"},"source":"sentry:microsoft","source_name":"Microsoft"},{"debug":{"status":"ok"},"download":{"features":{"has_debug_info":true,"has_sources":false,"has_symbols":true,"has_unwind_info":true},"status":"ok"},"location":"sentry://project_debug_file/46","source":"sentry:project","source_name":"Sentry","unwind":{"status":"ok"}}],"debug_status":"found","features":{"has_debug_info":true,"has_sources":false,"has_symbols":true,"has_unwind_info":true},"unwind_status":"found","type":"pe"}

And as long as the pdb or sym file (from gcc -g->cv2pdb->dump_syms) is uploaded using sentry-cli it can show line numbers even if the client didn't have the debug information.

Sorry if this is possible and I've missed it but I didn't manage to find anything related in the docs.

@Swatinem
Copy link
Member

Swatinem commented Aug 4, 2021

Can you link me to a specifc sentry issue you are seeing this?
I think you are on windows, right? Right now the default debug-images integration does not support windows unfortunately: https://github.com/getsentry/sentry-rust/tree/master/sentry-debug-images#sentry-rust-sdk-sentry-debug-images

Also, sentry can directly process pdb files. They are higher quality than going through dump_syms, so I recommend you upload those directly instead of converting them.

@zumoshi
Copy link
Author

zumoshi commented Aug 4, 2021

debug-images integration does not support windows

That is why I used the feature request format instead of bug report.

than going through dump_syms

That didn't seem to work for binaries made with mingw64.

Cargo doesn't create pdb files by itself when using mingw (instead embedding them inside the executable). Which works for gdb but despite having a way larger exe file size sentry-cli doesn't seem to see them:

$ sentry-cli difutil check player.exe
Debug Info File Check
  Type: pe executable
  Contained debug identifiers:
    > Debug ID: 00000000-0000-0000-0000-000000000000
      Code ID:  610a71f77c89000
      Arch:     x86_64
  Contained debug information:
    > unwind
  Usable: no (missing debug identifier, likely stripped)

cv2pdb has no problem extracting this info though, creating a pdb and stripping the exe file. and at the same time setting the debug_id header to match the files.
However, despite the difutil saying it is usable sentry-cli refuses to upload the pdb file:

$ sentry-cli difutil check player.exe
Debug Info File Check
  Type: pe executable
  Contained debug identifiers:
    > Debug ID: 328d3397-0dd9-4cee-af36-aa9ef562c7e7-1
      Code ID:  610a81deb8c000
      Arch:     x86_64
  Contained debug information:
    > unwind
  Usable: yes

$ sentry-cli difutil check player.pdb
Debug Info File Check
  Type: pdb debug companion
  Contained debug identifiers:
    > Debug ID: 328d3397-0dd9-4cee-af36-aa9ef562c7e7-1
      Arch:     x86_64
  Contained debug information:
    > symtab, debug
  Usable: yes

$ sentry-cli --url [..] --auth-token [..] upload-dif --org [..] --project [..] --include-sources --wait player.pdb player.exe
> Found 2 debug information files
error: malformed debug info file

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

Full log (with --log-level=debug) in this gist.

It works fine and shows stack trace/line numbers after going through dump_syms then uploaded though. So that is not a pressing issue. Windows support for sentry-debug-issues is a blocking issue though.

Can you link me to a specifc sentry issue you are seeing this?

If I wasn't clear, I want to be able to see stack traces with line numbers of panics on executables created on windows/mingw on release mode by uploading the symbol data separately. Which is not currently possible as far as I'm aware.

@mitchhentges
Copy link

Right now the default debug-images integration does not support windows unfortunately:

Heads up that I think this can be closed now that #366 landed 💪

@Swatinem
Copy link
Member

Good call, indeed, thanks for reminding me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants