diff options
Diffstat (limited to 'runtime/gc/heap_verification_test.cc')
-rw-r--r-- | runtime/gc/heap_verification_test.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/runtime/gc/heap_verification_test.cc b/runtime/gc/heap_verification_test.cc index 6caca84854..375412930b 100644 --- a/runtime/gc/heap_verification_test.cc +++ b/runtime/gc/heap_verification_test.cc @@ -83,7 +83,12 @@ TEST_F(VerificationTest, IsValidClassOrNotInHeap) { } TEST_F(VerificationTest, IsValidClassInHeap) { - TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING(); + // Now that the String class is allocated in the non-moving space when the + // runtime is running without a boot image (which is the case in this gtest), + // and we run with AddressSanizer, it is possible that the (presumably + // invalid) memory location `uint_klass - kObjectAlignment` tested below is + // poisoned when running with AddressSanizer. Disable this test in that case. + TEST_DISABLED_FOR_MEMORY_TOOL(); ScopedObjectAccess soa(Thread::Current()); VariableSizedHandleScope hs(soa.Self()); Handle<mirror::String> string( @@ -106,7 +111,13 @@ TEST_F(VerificationTest, DumpInvalidObjectInfo) { } TEST_F(VerificationTest, DumpValidObjectInfo) { - TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING(); + // Now that the String class is allocated in the non-moving space when the + // runtime is running without a boot image (which is the case in this gtest), + // and we run with AddressSanizer, it is possible that the calls to + // Verification::DumpObjectInfo below involving the String class object + // (`string->GetClass()`, `uint_klass`, etc.) access poisoned memory when they + // call Verification::DumpRAMAroundAddress. Disable this test in that case. + TEST_DISABLED_FOR_MEMORY_TOOL(); ScopedLogSeverity sls(LogSeverity::INFO); ScopedObjectAccess soa(Thread::Current()); Runtime* const runtime = Runtime::Current(); @@ -126,7 +137,13 @@ TEST_F(VerificationTest, DumpValidObjectInfo) { } TEST_F(VerificationTest, LogHeapCorruption) { - TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING(); + // Now that the String class is allocated in the non-moving space when the + // runtime is running without a boot image (which is the case in this gtest), + // and we run with AddressSanizer, it is possible that the call to + // Verification::LogHeapCorruption below involving the String class object + // (`string->GetClass()`) accesses poisoned memory when it calls + // Verification::DumpRAMAroundAddress. Disable this test in that case. + TEST_DISABLED_FOR_MEMORY_TOOL(); ScopedLogSeverity sls(LogSeverity::INFO); ScopedObjectAccess soa(Thread::Current()); Runtime* const runtime = Runtime::Current(); |