diff options
author | Michael Forney <mforney@mforney.org> | 2020-03-12 18:20:58 -0700 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2020-03-13 01:50:14 +0000 |
commit | a5fa28ddf0396e0cd77defde67d64cb8cde30a34 (patch) | |
tree | 7fadce62cd5087268f1c72ad0220ef3023798dd3 /src | |
parent | Remove sys/signal.h compatibility header (diff) | |
download | breakpad-a5fa28ddf0396e0cd77defde67d64cb8cde30a34.tar.xz |
Fix some bugs in CheckMicrodumpContents
The crash address from the microdump was never checked against
anything. Instead, the test was checking the value of a constant.
On 32-bit systems, an intptr_t cannot represent kCrashAddress
(0xDEADDEAD), causing a failure when the crash address is parsed
from the microdump. Instead, use uintptr_t, which matches the type
of kCrashAddress.
Change-Id: Ib5612743803609f7801dcfb98deaa8779e362025
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2100816
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/client/linux/microdump_writer/microdump_writer_unittest.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/linux/microdump_writer/microdump_writer_unittest.cc b/src/client/linux/microdump_writer/microdump_writer_unittest.cc index c2fea022..ca26fbfb 100644 --- a/src/client/linux/microdump_writer/microdump_writer_unittest.cc +++ b/src/client/linux/microdump_writer/microdump_writer_unittest.cc @@ -209,14 +209,14 @@ void CheckMicrodumpContents(const string& microdump_content, string token; unsigned crash_reason; string crash_reason_str; - intptr_t crash_address; + uintptr_t crash_address; crash_reason_tokens.ignore(2); // Ignore the "R " preamble. crash_reason_tokens >> std::hex >> crash_reason >> crash_reason_str >> crash_address; ASSERT_FALSE(crash_reason_tokens.fail()); ASSERT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED, crash_reason); ASSERT_EQ("DUMP_REQUESTED", crash_reason_str); - ASSERT_EQ(0xDEADDEADu, kCrashAddress); + ASSERT_EQ(kCrashAddress, crash_address); did_find_crash_reason = true; } else if (line.find("V ") == 0) { if (expected_info.product_info) |