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

DebugInfoSymbolProvider doesn't find binaries on macOS #827

Open
sfackler opened this issue Apr 6, 2023 · 4 comments
Open

DebugInfoSymbolProvider doesn't find binaries on macOS #827

sfackler opened this issue Apr 6, 2023 · 4 comments

Comments

@sfackler
Copy link
Contributor

sfackler commented Apr 6, 2023

The DebugInfoSymbolProvider always tries to load debuginfo at the location referenced in the debug_file field in the minidump module. However, on macOS, it appears that field is just the binary filename, while code_file contains the actual path to the binary. This results in the provider not being able to find any symbols.

Here's the debug dump of one of the modules in a minidump I produced as an example:

MINIDUMP_MODULE
  base_of_image                   = 0x1068f8000
  size_of_image                   = 0x4c000
  checksum                        = 0x0
  time_date_stamp                 = 0x0 1970-01-01T00:00:00Z
  module_name_rva                 = 0x24666c
  version_info.signature          = 0xfeef04bd
  version_info.struct_version     = 0x10000
  version_info.file_version       = 0x1:0x10000
  version_info.product_version    = 0x0:0x0
  version_info.file_flags_mask    = 0x0
  version_info.file_flags         = 0x0
  version_info.file_os            = 0x0
  version_info.file_type          = 0x0
  version_info.file_subtype       = 0x0
  version_info.file_date          = 0x0:0x0
  cv_record.data_size             = 41
  cv_record.rva                   = 0x2466e8
  misc_record.data_size           = 0
  misc_record.rva                 = 0x0
  (code_file)                     = "/opt/homebrew/Cellar/openssl@1.1/1.1.1t/lib/libssl.1.1.dylib"
  (code_identifier)               = "48eacf55e9d9356daca8d27bad42ed58"
  (cv_record).cv_signature        = 0x53445352
  (cv_record).signature           = 48eacf55-e9d9-356d-aca8-d27bad42ed58
  (cv_record).age                 = 0
  (cv_record).pdb_file_name       = "libssl.1.1.dylib"
  (misc_record)                   = (null)
  (debug_file)                    = "libssl.1.1.dylib"
  (debug_identifier)              = "48eacf55-e9d9-356d-aca8-d27bad42ed58"
  (version)                       = "0.1.1.0"

I'm not sure what the proper handling here should be - maybe falling back to code_file if debug_file's path can't be opened?

I'm using minidump and minidump processor 0.16, and minidumper 0.8.

@sfackler
Copy link
Contributor Author

sfackler commented Apr 6, 2023

It looks like modules produced on Linux do use the file path as debug_file, so this may be a problem in the macOS implementation of minidump-writer?

MINIDUMP_MODULE
  base_of_image                   = 0xffffa29d3000
  size_of_image                   = 0x31000
  checksum                        = 0x0
  time_date_stamp                 = 0x0 1970-01-01T00:00:00Z
  module_name_rva                 = 0xf7ce4
  version_info.signature          = 0x0
  version_info.struct_version     = 0x0
  version_info.file_version       = 0x0:0x0
  version_info.product_version    = 0x0:0x0
  version_info.file_flags_mask    = 0x0
  version_info.file_flags         = 0x0
  version_info.file_os            = 0x0
  version_info.file_type          = 0x0
  version_info.file_subtype       = 0x0
  version_info.file_date          = 0x0:0x0
  cv_record.data_size             = 20
  cv_record.rva                   = 0xf7cd0
  misc_record.data_size           = 0
  misc_record.rva                 = 0x0
  (code_file)                     = "/app/service/lib/linux-aarch64/libz.so.1"
  (code_identifier)               = "3d78e07ffd030091cc000094fd7bc1a8"
  (cv_record).cv_signature        = 0x4270454c
  (cv_record).build_id            = 3d78e07ffd030091cc000094fd7bc1a8
  (misc_record)                   = (null)
  (debug_file)                    = "/app/service/lib/linux-aarch64/libz.so.1"
  (debug_identifier)              = "7fe0783d-03fd-9100-cc00-0094fd7bc1a8"
  (version)                       = ""

@gabrielesvelto
Copy link
Collaborator

It looks like modules produced on Linux do use the file path as debug_file, so this may be a problem in the macOS implementation of minidump-writer?

It is possible. At Mozilla we haven't started using minidump-writer on macOS yet so it hasn't received as much testing as the Linux implementation which has been in production for a while now.

@luser
Copy link
Collaborator

luser commented May 4, 2023

I think this matches Breakpad's behavior. Only Windows has a truly native concept of debug_file (path to the PDB). We could use the locate-dwarf crate for this purpose (I wrote the original version, but haven't worked on it in years).

@ePirat
Copy link
Contributor

ePirat commented Aug 21, 2023

I ran into a similar issue when trying to use this tool for VLCs crash reporting server, CrashDragon, as we build VLC Windows binaries using GCC and mingw-w64 with a patched version of Breakpad to generate symfiles for these without pdb files.

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

4 participants