Re-enable ART code paths and tests for ASan that were disabled for Valgrind.
Test: SANITIZE_HOST=address ASAN_OPTIONS='detect_leaks=0' make test-art-host
Bug: 29282211
Change-Id: I127a8c11c7d3b778c8d538aec0782a10f042225c
diff --git a/runtime/exec_utils_test.cc b/runtime/exec_utils_test.cc
index a9c1ea2..c138ce3 100644
--- a/runtime/exec_utils_test.cc
+++ b/runtime/exec_utils_test.cc
@@ -36,12 +36,9 @@
command.push_back("/usr/bin/id");
}
std::string error_msg;
- if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) {
- // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks.
- // TODO: Valgrind is no longer supported, but Address Sanitizer is:
- // check whether the following code works with ASan.
- EXPECT_TRUE(Exec(command, &error_msg));
- }
+ // Historical note: Running on Valgrind failed due to some memory
+ // that leaks in thread alternate signal stacks.
+ EXPECT_TRUE(Exec(command, &error_msg));
EXPECT_EQ(0U, error_msg.size()) << error_msg;
}
@@ -52,13 +49,10 @@
std::vector<std::string> command;
command.push_back("bogus");
std::string error_msg;
- if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) {
- // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks.
- // TODO: Valgrind is no longer supported, but Address Sanitizer is:
- // check whether the following code works with ASan.
- EXPECT_FALSE(Exec(command, &error_msg));
- EXPECT_FALSE(error_msg.empty());
- }
+ // Historical note: Running on Valgrind failed due to some memory
+ // that leaks in thread alternate signal stacks.
+ EXPECT_FALSE(Exec(command, &error_msg));
+ EXPECT_FALSE(error_msg.empty());
}
TEST_F(ExecUtilsTest, EnvSnapshotAdditionsAreNotVisible) {
@@ -76,13 +70,10 @@
}
command.push_back(kModifiedVariable);
std::string error_msg;
- if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) {
- // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks.
- // TODO: Valgrind is no longer supported, but Address Sanitizer is:
- // check whether the following code works with ASan.
- EXPECT_FALSE(Exec(command, &error_msg));
- EXPECT_NE(0U, error_msg.size()) << error_msg;
- }
+ // Historical note: Running on Valgrind failed due to some memory
+ // that leaks in thread alternate signal stacks.
+ EXPECT_FALSE(Exec(command, &error_msg));
+ EXPECT_NE(0U, error_msg.size()) << error_msg;
}
TEST_F(ExecUtilsTest, EnvSnapshotDeletionsAreNotVisible) {
@@ -103,13 +94,10 @@
}
command.push_back(kDeletedVariable);
std::string error_msg;
- if (!(kRunningOnMemoryTool && kMemoryToolDetectsLeaks)) {
- // Running on Valgrind fails due to some memory that leaks in thread alternate signal stacks.
- // TODO: Valgrind is no longer supported, but Address Sanitizer is:
- // check whether the following code works with ASan.
- EXPECT_TRUE(Exec(command, &error_msg));
- EXPECT_EQ(0U, error_msg.size()) << error_msg;
- }
+ // Historical note: Running on Valgrind failed due to some memory
+ // that leaks in thread alternate signal stacks.
+ EXPECT_TRUE(Exec(command, &error_msg));
+ EXPECT_EQ(0U, error_msg.size()) << error_msg;
// Restore the variable's value.
EXPECT_EQ(setenv(kDeletedVariable, save_value, kOverwrite), 0);
}
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index b3a47c3..ce295aa 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -290,11 +290,6 @@
void* ucontext_ptr,
bool skip_frames) {
// Historical note: This was disabled when running under Valgrind (b/18119146).
- // TODO: Valgrind is no longer supported, but Address Sanitizer is:
- // check whether this test works with ASan.
- if (kRunningOnMemoryTool) {
- return;
- }
BacktraceMap* map = existing_map;
std::unique_ptr<BacktraceMap> tmp_map;