mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-29 00:32:35 +08:00
Mark Mentovai
56399b2553
snapshot/mac: MachOImageAnnotationsReader test shouldn’t crash with a
nullptr ProcessReader::Module. Prior to 64b87325b9de, the alignment problem meant that the Module for dyld was looking at the wrong address instead of dyld’s correct load address when a 32-bit process attempted to examine a crashing 64-bit process. This resulted in a crash during the MachOImageAnnotationsReader.CrashDyld test. ProcessReader::Module pointers are permitted to be nullptr. This allows minimal module data (its name) to be preserved even when no sense can be made of the module based on its load address. The producer, ProcessReader::InitializeModules(), and the non-test consumer, ModuleSnapshotMac::Initialize(), both accept this correctly. The producer’s documentation is updated to call this out. The ProcessReader test is also updated to tolerate this case without crashing by adding assertions. TEST=snapshot_test MachOImageAnnotationsReader.*, ProcessReader.* R=rsesek@chromium.org Review URL: https://codereview.chromium.org/989713002
Description
Languages
C++
92.6%
Objective-C++
2.5%
C
2%
Python
1.7%
Assembly
0.9%
Other
0.3%