Page MenuHomePhabricator

Fix a crasher due to an assert when two files have the same UUID but different paths.
ClosedPublic

Authored by clayborg on Thu, Sep 26, 2:40 PM.

Details

Summary

The PlaceholderObjectFile has an assert in SetLoadAddress that fires if "m_base == value" is not true. To avoid this, we create check that the base address matches, and if it doesn't we clear the module that was found using the UUID so that we create a new PlaceholderObjectFile. Added a test to cover this issue.

Diff Detail

Event Timeline

clayborg created this revision.Thu, Sep 26, 2:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Sep 26, 2:40 PM
clayborg updated this revision to Diff 222032.Thu, Sep 26, 2:42 PM

Remove printf that was left in.

Harbormaster completed remote builds in B38624: Diff 222032.
labath accepted this revision.Fri, Sep 27, 12:41 AM

Looks good, modulo the comment about shadowing.

lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
115

This implements something very similar to the GetBaseAddress function on line 81 (it is equivalent to const_cast<PlaceholderObjectFile *>(this)->GetBaseAddress().GetFileAddress()). In fact, the only reason you could define this function is because it is const, while the other method is not. Having two methods with the same name returning different types is very confusing. I think you should just drop this and replace the call on line 417 with objfile->GetBaseAddress().GetFileAddress(). That way, you don't even need to cast anything.

This revision is now accepted and ready to land.Fri, Sep 27, 12:41 AM
This revision was automatically updated to reflect the committed changes.