nhirata / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

MDRawDebug file format contains variable-sized pointers #621

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The MDRawDebug and MDRawLinkMap structs contain "void*"-typed fields.  I see a 
couple bad things about that:

  1. It means the file format varies depending on host word-size, which means (e.g.) 64-bit minidump-2-core can't handle 32-bit minidumps.

  2. The pointers aren't actually valid pointers within processing tools (e.g., minidump-2-core), so technically it's undefined behavior.  Also, it makes it riskier that applications might try treating them as valid pointers (though thankfully that would still require a cast).

Ideally they would just be uint64_t to be consistent with other memory 
references, but since we have 4+ years of Linux crash dumps with variable sized 
offsets that ship has probably sailed.

Probably the cleanest fix at this point is to replace MDRawDebug with 
MDRawDebug32 and MDRawDebug64 that use uint32_t and uint64_t, respectively, and 
just document that MD_LINUX_DSO_DEBUG points to one or the other depending on 
host word size (and similarly for MDRawLinkMap).

Original issue reported on code.google.com by mdemp...@google.com on 5 Dec 2014 at 11:41

GoogleCodeExporter commented 9 years ago
Fixed by r1410.

Original comment by mdemp...@chromium.org on 11 Dec 2014 at 1:19