Add hashing of the .text section to ProcessMinidump.
authorGreg Clayton <gclayton@fb.com>
Mon, 10 Aug 2020 22:07:47 +0000 (15:07 -0700)
committerGreg Clayton <gclayton@fb.com>
Mon, 24 Aug 2020 18:43:50 +0000 (11:43 -0700)
commit0e6c9a6e7940a2f8ee624358d828acffdb9ccca5
tree5dff290dba5c29882604a5fb8fbc8833558c2bb1
parent44ee9d070adee1aed105f90d88b30b8802d90d35
Add hashing of the .text section to ProcessMinidump.

Breakpad will always have a UUID for binaries when it creates minidump files. If an ELF files has a GNU build ID, it will use that. If it doesn't, it will create one by hashing up to the first 4096 bytes of the .text section. LLDB was not able to load these binaries even when we had the right binary because the UUID didn't match. LLDB will use the GNU build ID first as the main UUID for a binary and fallback onto a 8 byte CRC if a binary doesn't have one. With this fix, we will check for the Breakpad hash or the Facebook hash (a modified version of the breakpad hash that collides a bit less) and accept binaries when these hashes match.

Differential Revision: https://reviews.llvm.org/D86261
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
lldb/test/API/functionalities/postmortem/minidump-new/libbreakpad-overflow.yaml [new file with mode: 0644]
lldb/test/API/functionalities/postmortem/minidump-new/libbreakpad.yaml [new file with mode: 0644]
lldb/test/API/functionalities/postmortem/minidump-new/linux-arm-breakpad-uuid-match.yaml [new file with mode: 0644]
lldb/test/API/functionalities/postmortem/minidump-new/linux-arm-facebook-uuid-match.yaml [new file with mode: 0644]