Revert "[ASan] Ensure Symbolize Flag setting on Windows through __asan_default_options() is maintained throughout runtime (#132811)"
This reverts commit 7bf43fec3aa1c7bb64749efefe0f5fd1e377c1fd. Multiple buildbot failures have been reported: https://github.com/llvm/llvm-project/pull/132811
This commit is contained in:
parent
2242e28671
commit
2344f82b58
@ -241,8 +241,6 @@ void InitializeFlags() {
|
|||||||
InitializeDefaultFlags();
|
InitializeDefaultFlags();
|
||||||
ProcessFlags();
|
ProcessFlags();
|
||||||
ApplyFlags();
|
ApplyFlags();
|
||||||
if (!common_flags()->symbolize)
|
|
||||||
Symbolizer::ClearTools();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
# if CAN_SANITIZE_UB
|
# if CAN_SANITIZE_UB
|
||||||
|
@ -136,8 +136,6 @@ class Symbolizer final {
|
|||||||
/// (if it wasn't already initialized).
|
/// (if it wasn't already initialized).
|
||||||
static Symbolizer *GetOrInit();
|
static Symbolizer *GetOrInit();
|
||||||
static void LateInitialize();
|
static void LateInitialize();
|
||||||
static void ClearTools();
|
|
||||||
|
|
||||||
// Returns a list of symbolized frames for a given address (containing
|
// Returns a list of symbolized frames for a given address (containing
|
||||||
// all inlined functions, if necessary).
|
// all inlined functions, if necessary).
|
||||||
SymbolizedStack *SymbolizePC(uptr address);
|
SymbolizedStack *SymbolizePC(uptr address);
|
||||||
|
@ -26,16 +26,6 @@ Symbolizer *Symbolizer::GetOrInit() {
|
|||||||
return symbolizer_;
|
return symbolizer_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the 'symbolize' flag is set to 0, it clears the tools
|
|
||||||
// associated with the symbolizer to prevent unnecessary symbolization and
|
|
||||||
// resource usage. This is necessary because of the late binding of the
|
|
||||||
// overridden method, __asan_default_options().
|
|
||||||
void Symbolizer::ClearTools() {
|
|
||||||
SpinMutexLock l(&init_mu_);
|
|
||||||
if (symbolizer_)
|
|
||||||
symbolizer_->tools_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
// See sanitizer_symbolizer_markup.cpp.
|
// See sanitizer_symbolizer_markup.cpp.
|
||||||
#if !SANITIZER_SYMBOLIZER_MARKUP
|
#if !SANITIZER_SYMBOLIZER_MARKUP
|
||||||
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
// RUN: %clangxx_asan -O0 %s -o %t
|
|
||||||
// RUN: %env_asan_opts=symbolize=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-OFF
|
|
||||||
// RUN: %env_asan_opts=symbolize=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-ON
|
|
||||||
|
|
||||||
// RUN: %clangxx_asan -O0 %s -o %t -DUSER_FUNCTION_OFF
|
|
||||||
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-OFF
|
|
||||||
// RUN: %env_asan_opts=symbolize=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-OFF
|
|
||||||
// RUN: %env_asan_opts=symbolize=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-ON
|
|
||||||
|
|
||||||
// RUN: %clangxx_asan -O0 %s -o %t -DUSER_FUNCTION_ON
|
|
||||||
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-ON
|
|
||||||
// RUN: %env_asan_opts=symbolize=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-OFF
|
|
||||||
// RUN: %env_asan_opts=symbolize=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SYMBOLIZE-ON
|
|
||||||
#if USER_FUNCTION_OFF
|
|
||||||
|
|
||||||
extern "C" __declspec(dllexport) extern const char *__asan_default_options() {
|
|
||||||
return "symbolize=0";
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USER_FUNCTION_ON
|
|
||||||
|
|
||||||
extern "C" __declspec(dllexport) extern const char *__asan_default_options() {
|
|
||||||
return "symbolize=1";
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
volatile static int heapBufferOverflowValue = 10;
|
|
||||||
int main() {
|
|
||||||
int *array = new int[10];
|
|
||||||
heapBufferOverflowValue = array[10]; // CHECK-SYMBOLIZE-ON: symbolize.cpp:36
|
|
||||||
return 0; // CHECK-SYMBOLIZE-OFF: symbolize.cpp.tmp+0x
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user