diff options
author | Dino Radakovic <dinor@google.com> | 2023-08-01 13:19:00 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-08-01 13:19:45 -0700 |
commit | c66815ac2ee561cd97e03780c5aa2ad951fbc90f (patch) | |
tree | b7e9be5d540b67b85c4fe8b6cab74ef0587b8346 /absl/container | |
parent | f6acd471e2b9063e9d56a6e7867023d87649a03c (diff) |
raw_hash_set_test: Expect tsan to catch heap-use-after-free on iterators invalidated by rehashing
PiperOrigin-RevId: 552901078
Change-Id: I137d01fe87b1bbf591b400305f6f7919982fc1c9
Diffstat (limited to 'absl/container')
-rw-r--r-- | absl/container/internal/raw_hash_set_test.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/absl/container/internal/raw_hash_set_test.cc b/absl/container/internal/raw_hash_set_test.cc index c18dce3b..242a97cb 100644 --- a/absl/container/internal/raw_hash_set_test.cc +++ b/absl/container/internal/raw_hash_set_test.cc @@ -2204,10 +2204,14 @@ TEST(TableDeathTest, IteratorInvalidAssertsEqualityOperator) { for (int i = 0; i < 10; ++i) t1.insert(i); // There should have been a rehash in t1. if (kMsvc) return; // MSVC doesn't support | in regex. + + // NOTE(b/293887834): After rehashing, iterators will contain pointers to + // freed memory, which may be detected by ThreadSanitizer. const char* const kRehashedDeathMessage = SwisstableGenerationsEnabled() ? kInvalidIteratorDeathMessage - : "Invalid iterator comparison.*might have rehashed.*config=asan"; + : "Invalid iterator comparison.*might have rehashed.*config=asan" + "|ThreadSanitizer: heap-use-after-free"; EXPECT_DEATH_IF_SUPPORTED(void(iter1 == t1.begin()), kRehashedDeathMessage); } |