Page MenuHomePhabricator

Don't include the Age in the UUID for CvRecordPdb70 UUID records in minidump files
ClosedPublic

Authored by clayborg on Aug 29 2018, 10:11 AM.

Details

Summary

The CvRecordPdb70 structure looks like:

struct CvRecordPdb70 {
  uint8_t Uuid[16];
  llvm::support::ulittle32_t Age;
  // char PDBFileName[];
};

We are currently including the "Age" in the UUID which seems wrong. I am proposing this fix to avoid including the age in the UUID since it is wrong for Apple targets. We want the UUID of a module to match the UUID that would be found in executable files. I can modify this patch to only do this for Apple vendors in the target triple if needed, but it seemed like this would be the functionality that people would expect on all targets, so I will start with this patch and see what people think.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

clayborg created this revision.Aug 29 2018, 10:11 AM

For PE/COFF files, the Age is also in the executable and Guid+Age actually
constitute a 20-byte UUID. Is this not the case on Apple? What object file
format are you dealing with?

lemo added a subscriber: zturner.Aug 29 2018, 10:47 AM

I'm curious too: where did the PDB70 age create matching problems?

On a related note, I just noticed that ObjectFilePECOFF::GetUUID() doesn't
have a real implementation (just returns false). How do we extract module
UUID for PE/COFF files?

For PE/COFF files, the Age is also in the executable and Guid+Age actually
constitute a 20-byte UUID. Is this not the case on Apple? What object file
format are you dealing with?

Breakpad files that contain darwin crashes have the age set to zero, and then this hoses us the ability to match UUIDs for Apple stuff. Sounds like I need to make this apple specific

clayborg updated this revision to Diff 163143.Aug 29 2018, 11:06 AM

Make 16 byte UUIDs Apple specific.

I'm curious too: where did the PDB70 age create matching problems?

For breakpad ARM and ARM64 minidumps that are for Apple vendor triples.

On a related note, I just noticed that ObjectFilePECOFF::GetUUID() doesn't
have a real implementation (just returns false). How do we extract module
UUID for PE/COFF files?

Not sure on that, nor what the PDB70 UUID actually is.

lemo accepted this revision.Aug 29 2018, 12:12 PM

Looks good (with one inline request for a comment)

source/Plugins/Process/minidump/MinidumpParser.cpp
85

please add a comment describing the situation (breakpad producing debug ids which don't match the binaries)

This revision is now accepted and ready to land.Aug 29 2018, 12:12 PM
This revision was automatically updated to reflect the committed changes.