Closed Bug 1505007 Opened 6 years ago Closed 6 years ago

GUID/ELF identifiers are truncated on Fennec

Categories

(Toolkit :: Crash Reporting, enhancement)

All
Android
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: gsvelto, Assigned: gsvelto)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1502424 +++

While preparing the fix for bug 1502424 I noticed that we also use sizeof(MDGUID) in the exception handler when retrieving ELF file ID. Specifically this happens in the Fennec exception handler and during Fennec startup. Replacing it with kDefaultBuildIdSize should cut down on the number of mmap()s we do in both cases.
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
This also refactors the surrounding code for better readability and removes
some duplicate code.
Thanks for the review Ted, while fixing up the code I noticed that something else was amiss: the GUIDs we're adding via AddMappingInfo were being truncated, not because we didn't allocate a vector large enough but because breakpad's truncating them here:

https://searchfox.org/mozilla-central/rev/b096dcf0ea226af628fe03f7e7acb56a25853533/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc#785

So for every library we added via AddMappingInfo() we were throwing away 4 digits from the GUID, that's including libxul.so :-/ I've verified that the GUIDs are truncated in the resulting minidump. Fortunately this is happening in breakpad's code we forked so I'll just add the fix to this patch.
I'm super-confused, I just noticed that the actual destination field for that GUID is also hardcoded to 16 bytes:

https://searchfox.org/mozilla-central/rev/b096dcf0ea226af628fe03f7e7acb56a25853533/toolkit/crashreporter/breakpad-client/linux/dump_writer_common/mapping_info.h#66

I have the feeling that this needs to be fixed across all users of this particular code. Those IDs are not automatically 16 bytes in size, right Ted?
Flags: needinfo?(ted)
I'm changing the bug name to reflect the additional scope.
Summary: Use larger stack-allocated ELF identifiers → GUID/ELF identifiers are truncated on Fennec
Attachment #9022915 - Attachment description: 1505007 - Use larger stack-allocated ELF identifiers on Android → Bug 1505007 - Do not truncate ELF identifiers on Android
Pushed by gsvelto@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f63693feadd5
Do not truncate ELF identifiers on Android r=ted
https://hg.mozilla.org/mozilla-central/rev/f63693feadd5
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Flags: needinfo?(ted)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: