diff options
| author | 2018-09-10 13:05:21 +0000 | |
|---|---|---|
| committer | 2018-09-10 13:05:21 +0000 | |
| commit | e752360c5a420bb4af304fa229784fbd3a636e63 (patch) | |
| tree | b13577ee4562a1797fec273b330afc1fd6b1f705 /runtime/gc/heap_verification_test.cc | |
| parent | 07d2c123a6f8d3bd8a9bef531be10d60e9df94cd (diff) | |
| parent | 5fe2f34262e4dbeebee5ccc4e465b53284632e4c (diff) | |
Merge "Disable some tests in heap_verification_test when running with ASan."
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(); |