Skip to content

Commit

Permalink
Permit drop frames test to run under sanitizers.
Browse files Browse the repository at this point in the history
They do not produce working profiles, but this allows us to confirm our
allocation/deallocation test patterns are UB-free.

PiperOrigin-RevId: 705163461
Change-Id: I8e0c9dc21b85aa18673bba2edcc14ad0c85d9caf
  • Loading branch information
ckennelly authored and copybara-github committed Dec 11, 2024
1 parent 36c213b commit f939065
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 0 additions & 5 deletions tcmalloc/testing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -885,11 +885,6 @@ cc_test(
create_tcmalloc_testsuite(
name = "profile_drop_frames_test",
srcs = ["profile_drop_frames_test.cc"],
tags = [
"noasan",
"nomsan",
"notsan",
],
deps = [
"//tcmalloc:malloc_extension",
"//tcmalloc/internal:profile_builder",
Expand Down
11 changes: 11 additions & 0 deletions tcmalloc/testing/profile_drop_frames_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,22 @@ TEST(AllocationSampleTest, ProfileDropFrames) {
});
};
check(alloc_profile);

#if !defined(ABSL_HAVE_ADDRESS_SANITIZER) && \
!defined(ABSL_HAVE_MEMORY_SANITIZER) && \
!defined(ABSL_HAVE_THREAD_SANITIZER) && \
!defined(UNDEFINED_BEHAVIOR_SANITIZER)
EXPECT_GT(got_stacks, 20);
#endif
got_stacks = 0;
check(lifetime_profile);
#if !defined(ABSL_HAVE_ADDRESS_SANITIZER) && \
!defined(ABSL_HAVE_MEMORY_SANITIZER) && \
!defined(ABSL_HAVE_THREAD_SANITIZER) && \
!defined(UNDEFINED_BEHAVIOR_SANITIZER)
EXPECT_GT(got_stacks, 20);
EXPECT_FALSE(failed);
#endif
}

} // namespace

0 comments on commit f939065

Please sign in to comment.