Revert "[sanitizer] Add facility to print the full StackDepot"

This reverts commit 2ffaa9a173.

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.
This commit is contained in:
Teresa Johnson 2020-09-17 21:18:16 -07:00
parent f55963d501
commit 6e475e1288
4 changed files with 1 additions and 40 deletions

View File

@ -115,12 +115,6 @@ void StackDepotUnlockAll() {
theDepot.UnlockAll();
}
void StackDepotPrintAll() {
#if !SANITIZER_GO
theDepot.PrintAll();
#endif
}
bool StackDepotReverseMap::IdDescPair::IdComparator(
const StackDepotReverseMap::IdDescPair &a,
const StackDepotReverseMap::IdDescPair &b) {

View File

@ -41,7 +41,6 @@ StackTrace StackDepotGet(u32 id);
void StackDepotLockAll();
void StackDepotUnlockAll();
void StackDepotPrintAll();
// Instantiating this class creates a snapshot of StackDepot which can be
// efficiently queried with StackDepotGet(). You can use it concurrently with

View File

@ -13,11 +13,9 @@
#ifndef SANITIZER_STACKDEPOTBASE_H
#define SANITIZER_STACKDEPOTBASE_H
#include <stdio.h>
#include "sanitizer_atomic.h"
#include "sanitizer_internal_defs.h"
#include "sanitizer_mutex.h"
#include "sanitizer_atomic.h"
#include "sanitizer_persistent_allocator.h"
namespace __sanitizer {
@ -36,7 +34,6 @@ class StackDepotBase {
void LockAll();
void UnlockAll();
void PrintAll();
private:
static Node *find(Node *s, args_type args, u32 hash);
@ -175,21 +172,6 @@ void StackDepotBase<Node, kReservedBits, kTabSizeLog>::UnlockAll() {
}
}
template <class Node, int kReservedBits, int kTabSizeLog>
void StackDepotBase<Node, kReservedBits, kTabSizeLog>::PrintAll() {
for (int i = 0; i < kTabSize; ++i) {
atomic_uintptr_t *p = &tab[i];
lock(p);
uptr v = atomic_load(p, memory_order_relaxed);
Node *s = (Node *)(v & ~1UL);
for (; s; s = s->link) {
Printf("Stack for id %u:\n", s->id);
s->load().Print();
}
unlock(p, s);
}
}
} // namespace __sanitizer
#endif // SANITIZER_STACKDEPOTBASE_H

View File

@ -64,20 +64,6 @@ TEST(SanitizerCommon, StackDepotSeveral) {
EXPECT_NE(i1, i2);
}
TEST(SanitizerCommon, StackDepotPrint) {
uptr array1[] = {1, 2, 3, 4, 7};
StackTrace s1(array1, ARRAY_SIZE(array1));
u32 i1 = StackDepotPut(s1);
uptr array2[] = {1, 2, 3, 4, 8, 9};
StackTrace s2(array2, ARRAY_SIZE(array2));
u32 i2 = StackDepotPut(s2);
EXPECT_NE(i1, i2);
EXPECT_EXIT(
(StackDepotPrintAll(), exit(0)), ::testing::ExitedWithCode(0),
"Stack for id .*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x6.*Stack for id "
".*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x7.*#5 0x8.*");
}
TEST(SanitizerCommon, StackDepotReverseMap) {
uptr array1[] = {1, 2, 3, 4, 5};
uptr array2[] = {7, 1, 3, 0};