diff options
author | Peter Collingbourne <pcc@google.com> | 2020-05-08 10:11:19 -0700 |
---|---|---|
committer | Peter Collingbourne <pcc@google.com> | 2020-05-08 10:14:47 -0700 |
commit | bbe6905d7e9a85522eec7cb95e0ccd5930bdd6cb (patch) | |
tree | 1a74c707e9b2211f7e2a123b429d4db2b72274aa /debuggerd/debuggerd_test.cpp | |
parent | d427b54c535d3f56e9db947efa4878346541f890 (diff) |
Add stack trace coverage to MTE tests.
It's impractical to test the contents of the stack trace, but we
should at least test that *a* stack trace is present, which would
have caught the bug fixed by r.android.com/1306754 .
Bug: 135772972
Change-Id: Ic5e0b997caa53c7eeec4e5185df5c043c9d4fe3d
Diffstat (limited to 'debuggerd/debuggerd_test.cpp')
-rw-r--r-- | debuggerd/debuggerd_test.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index 25417a985..9d7658eb0 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp @@ -379,7 +379,12 @@ TEST_F(CrasherTest, mte_uaf) { ConsumeFd(std::move(output_fd), &result); ASSERT_MATCH(result, R"(signal 11 \(SIGSEGV\), code 9 \(SEGV_MTESERR\))"); - ASSERT_MATCH(result, R"(Cause: \[MTE\]: Use After Free, 0 bytes into a 16-byte allocation)"); + ASSERT_MATCH(result, R"(Cause: \[MTE\]: Use After Free, 0 bytes into a 16-byte allocation.* + +allocated by thread .* + #00 pc)"); + ASSERT_MATCH(result, R"(deallocated by thread .* + #00 pc)"); #else GTEST_SKIP() << "Requires aarch64 + ANDROID_EXPERIMENTAL_MTE"; #endif @@ -410,7 +415,10 @@ TEST_F(CrasherTest, mte_overflow) { ConsumeFd(std::move(output_fd), &result); ASSERT_MATCH(result, R"(signal 11 \(SIGSEGV\))"); - ASSERT_MATCH(result, R"(Cause: \[MTE\]: Buffer Overflow, 0 bytes right of a 16-byte allocation)"); + ASSERT_MATCH(result, R"(Cause: \[MTE\]: Buffer Overflow, 0 bytes right of a 16-byte allocation.* + +allocated by thread .* + #00 pc)"); #else GTEST_SKIP() << "Requires aarch64 + ANDROID_EXPERIMENTAL_MTE"; #endif @@ -441,7 +449,10 @@ TEST_F(CrasherTest, mte_underflow) { ConsumeFd(std::move(output_fd), &result); ASSERT_MATCH(result, R"(signal 11 \(SIGSEGV\), code 9 \(SEGV_MTESERR\))"); - ASSERT_MATCH(result, R"(Cause: \[MTE\]: Buffer Underflow, 4 bytes left of a 16-byte allocation)"); + ASSERT_MATCH(result, R"(Cause: \[MTE\]: Buffer Underflow, 4 bytes left of a 16-byte allocation.* + +allocated by thread .* + #00 pc)"); #else GTEST_SKIP() << "Requires aarch64 + ANDROID_EXPERIMENTAL_MTE"; #endif |