-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Incorrect CodeId casing for PE files #436
Comments
Or, alternatively, we could keep everything the way it is today, and anyone who wants to use CodeIds to interact with symbol servers will need to do some post processing on the CodeId, by uppercasing the first 8 digits and lowercasing the remainder. |
Interestingly, Breakpad's Windows |
It appears symbolicator has always been taking this approach: https://github.com/getsentry/symbolicator/blob/2fb9989e376059beeb017d77b100190ce6609c57/crates/symbolicator/src/utils/paths.rs#L86-L92 |
To me, this doesn't look like a bug - as long as there's no industry-wide standard that defines that a hexadecimal string representation must be in a given format. Yes, it may be useful to change this to match whatever some symbol servers expect, but it may also break something else. Not sure that's a good tradeoff. |
The CodeId of a PeObject can be used to obtain exe and dll files from symbol servers. Examples:
https://renderdoc.org/symbols/renderdoc.dll/61015E74442b000/renderdoc.dl_
https://msdl.microsoft.com/download/symbols/ntoskrnl.exe/7A04BFB21046000/ntoskrnl.exe
Some symbol servers are case-sensitive. In the renderdoc example above, it has to be
61015E74442b000
(with lowercase b) rather than61015E74442B000
, otherwise the server returns a 404.For PE files, the code ID is constructed as follows:
61015E74
is the timestamp, in uppercase hex, and442b000
is the image size, in lowercase hex.See also https://randomascii.wordpress.com/2013/03/09/symbols-the-microsoft-way/:
PeObject::code_id()
currently builds an all-lowercase string:symbolic/symbolic-debuginfo/src/pe.rs
Line 101 in 9d308ef
And then
CodeId::new
callsmake_ascii_lowercase()
, just to be sure:https://github.com/getsentry/rust-debugid/blob/9fb71ae2c1bd576efdae9c7856314459048da5d8/src/lib.rs#L300
And then in dump_syms, we call
to_uppercase()
:https://github.com/mozilla/dump_syms/blob/7fc891c7ff44d7b4a62951f94f22729ec66d0622/src/windows/pdb.rs#L532
To make this work properly with case-sensitive symbol servers, it seems like we need to preserve the case everywhere and use
{:08X}{:x}
inPeObject::code_id()
.The text was updated successfully, but these errors were encountered: