Fixup non-canonical fault addresses for amd64.

This uses DisassemblerObjdump to add a processing step in
MinidumpProcessor to compute the true faulting address from register
state and disassembly of the fault instruction when the fault address
is suspicious (-1).

Bug: 901847
Change-Id: Ia1f77d542c4055c82ce2504db8c84a9e52001866
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3932957
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
Mark Brand
2022-10-07 10:44:20 +02:00
committed by Ivan Penkov
parent 6289830b67
commit 57d1743662
4 changed files with 110 additions and 4 deletions

View File

@@ -799,6 +799,25 @@ TEST_F(MinidumpProcessorTest, TestFastFailException) {
ASSERT_EQ(state.crash_reason(), "FAST_FAIL_FATAL_APP_EXIT");
}
#ifdef __linux__
TEST_F(MinidumpProcessorTest, TestNonCanonicalAddress) {
// This tests if we can correctly fixup non-canonical address GPF fault
// addresses.
// Dump is captured from a toy executable and is readable by windbg.
MinidumpProcessor processor(nullptr, nullptr /*&supplier, &resolver*/);
processor.set_enable_objdump(true);
string minidump_file = GetTestDataPath()
+ "write_av_non_canonical.dmp";
ProcessState state;
ASSERT_EQ(processor.Process(minidump_file, &state),
google_breakpad::PROCESS_OK);
ASSERT_TRUE(state.crashed());
ASSERT_EQ(state.crash_address(), 0xfefefefefefefefeU);
}
#endif // __linux__
} // namespace
int main(int argc, char* argv[]) {