This is an archive of the discontinued LLVM Phabricator instance.

Don't treat corefile binaries like dylibs in the shared cache, even if they say they are
AbandonedPublic

Authored by jasonmolenda on Apr 9 2021, 12:16 AM.

Details

Reviewers
friss
Summary

There is a corefile writer that is including uninitialized data in the Mach-O header 'flags' field. I'll work with them to fix that, but it only causes a problem in one part of lldb today, in ObjectFileMachO::SanitizeSegmentCommand where there is code that is trying to detect an LC_SEGMENT in a binary in the shared cache. The shared cache flag bit is set in this corefile, so we adjust the offsets and the corefile parsing fails big time.

lldb doesn't make a lot of decisions based on the mach header flags field, and even fewer of them when dealing with corefiles, so to handle these corefiles that are floating around, I'd like to add a guard to the code to explicitly opt out when working on a corefile, to work around this.

Fred, this is an edit to your change from last summer in https://reviews.llvm.org/D83023 . Are you OK with this.

Diff Detail

Event Timeline

jasonmolenda created this revision.Apr 9 2021, 12:16 AM
jasonmolenda requested review of this revision.Apr 9 2021, 12:16 AM
jasonmolenda abandoned this revision.Apr 28 2022, 2:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2022, 2:18 PM