Check for data races when reading JIT/DEX entries.
Update the entries only when the list is modified by the runtime.
Check that the list wasn't concurrently modified when being read.
Bug: 124287208
Test: libunwindstack_test
Test: art/test.py -b --host -r -t 137-cfi
Change-Id: I87ba70322053a01b3d5be1fdf6310e1dc21bb084
diff --git a/libunwindstack/tests/DexFileTest.cpp b/libunwindstack/tests/DexFileTest.cpp
index 0149a42..df7b31d 100644
--- a/libunwindstack/tests/DexFileTest.cpp
+++ b/libunwindstack/tests/DexFileTest.cpp
@@ -177,11 +177,11 @@
std::string method;
uint64_t method_offset;
- ASSERT_TRUE(dex_file->GetMethodInformation(0x102, &method, &method_offset));
+ ASSERT_TRUE(dex_file->GetFunctionName(0x4102, &method, &method_offset));
EXPECT_EQ("Main.<init>", method);
EXPECT_EQ(2U, method_offset);
- ASSERT_TRUE(dex_file->GetMethodInformation(0x118, &method, &method_offset));
+ ASSERT_TRUE(dex_file->GetFunctionName(0x4118, &method, &method_offset));
EXPECT_EQ("Main.main", method);
EXPECT_EQ(0U, method_offset);
}
@@ -195,9 +195,9 @@
std::string method;
uint64_t method_offset;
- EXPECT_FALSE(dex_file->GetMethodInformation(0x100000, &method, &method_offset));
+ EXPECT_FALSE(dex_file->GetFunctionName(0x100000, &method, &method_offset));
- EXPECT_FALSE(dex_file->GetMethodInformation(0x98, &method, &method_offset));
+ EXPECT_FALSE(dex_file->GetFunctionName(0x98, &method, &method_offset));
}
} // namespace unwindstack