Skip to content

Commit 6e475e1

Browse files
committed
Revert "[sanitizer] Add facility to print the full StackDepot"
This reverts commit 2ffaa9a. There were 2 reported bot failures that need more investigation: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/69871/steps/stage%201%20check/logs/stdio This one is in my new test. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/39187/steps/check-fuzzer/logs/stdio This one seems completely unrelated.
1 parent f55963d commit 6e475e1

File tree

4 files changed

+1
-40
lines changed

4 files changed

+1
-40
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ void StackDepotUnlockAll() {
115115
theDepot.UnlockAll();
116116
}
117117

118-
void StackDepotPrintAll() {
119-
#if !SANITIZER_GO
120-
theDepot.PrintAll();
121-
#endif
122-
}
123-
124118
bool StackDepotReverseMap::IdDescPair::IdComparator(
125119
const StackDepotReverseMap::IdDescPair &a,
126120
const StackDepotReverseMap::IdDescPair &b) {

compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ StackTrace StackDepotGet(u32 id);
4141

4242
void StackDepotLockAll();
4343
void StackDepotUnlockAll();
44-
void StackDepotPrintAll();
4544

4645
// Instantiating this class creates a snapshot of StackDepot which can be
4746
// efficiently queried with StackDepotGet(). You can use it concurrently with

compiler-rt/lib/sanitizer_common/sanitizer_stackdepotbase.h

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
#ifndef SANITIZER_STACKDEPOTBASE_H
1414
#define SANITIZER_STACKDEPOTBASE_H
1515

16-
#include <stdio.h>
17-
18-
#include "sanitizer_atomic.h"
1916
#include "sanitizer_internal_defs.h"
2017
#include "sanitizer_mutex.h"
18+
#include "sanitizer_atomic.h"
2119
#include "sanitizer_persistent_allocator.h"
2220

2321
namespace __sanitizer {
@@ -36,7 +34,6 @@ class StackDepotBase {
3634

3735
void LockAll();
3836
void UnlockAll();
39-
void PrintAll();
4037

4138
private:
4239
static Node *find(Node *s, args_type args, u32 hash);
@@ -175,21 +172,6 @@ void StackDepotBase<Node, kReservedBits, kTabSizeLog>::UnlockAll() {
175172
}
176173
}
177174

178-
template <class Node, int kReservedBits, int kTabSizeLog>
179-
void StackDepotBase<Node, kReservedBits, kTabSizeLog>::PrintAll() {
180-
for (int i = 0; i < kTabSize; ++i) {
181-
atomic_uintptr_t *p = &tab[i];
182-
lock(p);
183-
uptr v = atomic_load(p, memory_order_relaxed);
184-
Node *s = (Node *)(v & ~1UL);
185-
for (; s; s = s->link) {
186-
Printf("Stack for id %u:\n", s->id);
187-
s->load().Print();
188-
}
189-
unlock(p, s);
190-
}
191-
}
192-
193175
} // namespace __sanitizer
194176

195177
#endif // SANITIZER_STACKDEPOTBASE_H

compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,6 @@ TEST(SanitizerCommon, StackDepotSeveral) {
6464
EXPECT_NE(i1, i2);
6565
}
6666

67-
TEST(SanitizerCommon, StackDepotPrint) {
68-
uptr array1[] = {1, 2, 3, 4, 7};
69-
StackTrace s1(array1, ARRAY_SIZE(array1));
70-
u32 i1 = StackDepotPut(s1);
71-
uptr array2[] = {1, 2, 3, 4, 8, 9};
72-
StackTrace s2(array2, ARRAY_SIZE(array2));
73-
u32 i2 = StackDepotPut(s2);
74-
EXPECT_NE(i1, i2);
75-
EXPECT_EXIT(
76-
(StackDepotPrintAll(), exit(0)), ::testing::ExitedWithCode(0),
77-
"Stack for id .*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x6.*Stack for id "
78-
".*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x7.*#5 0x8.*");
79-
}
80-
8167
TEST(SanitizerCommon, StackDepotReverseMap) {
8268
uptr array1[] = {1, 2, 3, 4, 5};
8369
uptr array2[] = {7, 1, 3, 0};

0 commit comments

Comments
 (0)