Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2668)

Unified Diff: base/debug/proc_maps_linux_unittest.cc

Issue 774483004: Revert of Turn on stack use-after-return detection in non-official ASan builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/sanitizers/sanitizer_options.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/proc_maps_linux_unittest.cc
diff --git a/base/debug/proc_maps_linux_unittest.cc b/base/debug/proc_maps_linux_unittest.cc
index cbc0dd036ad015522623f5cc907854f8b016e76c..c9f2267e166e15cdcf8241cee9f8b20d51f3ca86 100644
--- a/base/debug/proc_maps_linux_unittest.cc
+++ b/base/debug/proc_maps_linux_unittest.cc
@@ -181,19 +181,20 @@
}
}
-#if defined(ADDRESS_SANITIZER)
-// AddressSanitizer may move local variables to a dedicated "fake stack" which
-// is outside the stack region listed in /proc/self/maps. We disable ASan
-// instrumentation for this function to force the variable to be local.
-__attribute__((no_sanitize_address))
-#endif
-void CheckProcMapsRegions(const std::vector<MappedMemoryRegion> &regions) {
+TEST(ProcMapsTest, ReadProcMaps) {
+ std::string proc_maps;
+ ASSERT_TRUE(ReadProcMaps(&proc_maps));
+
+ std::vector<MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(proc_maps, &regions));
+ ASSERT_FALSE(regions.empty());
+
// We should be able to find both the current executable as well as the stack
- // mapped into memory. Use the address of |exe_path| as a way of finding the
+ // mapped into memory. Use the address of |proc_maps| as a way of finding the
// stack.
FilePath exe_path;
EXPECT_TRUE(PathService::Get(FILE_EXE, &exe_path));
- uintptr_t address = reinterpret_cast<uintptr_t>(&exe_path);
+ uintptr_t address = reinterpret_cast<uintptr_t>(&proc_maps);
bool found_exe = false;
bool found_stack = false;
bool found_address = false;
@@ -245,17 +246,6 @@
}
}
-TEST(ProcMapsTest, ReadProcMaps) {
- std::string proc_maps;
- ASSERT_TRUE(ReadProcMaps(&proc_maps));
-
- std::vector<MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(proc_maps, &regions));
- ASSERT_FALSE(regions.empty());
-
- CheckProcMapsRegions(regions);
-}
-
TEST(ProcMapsTest, ReadProcMapsNonEmptyString) {
std::string old_string("I forgot to clear the string");
std::string proc_maps(old_string);
« no previous file with comments | « no previous file | build/sanitizers/sanitizer_options.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698