forked from OSchip/llvm-project
[ASan] make ASan assume ASAN_OPTIONS=symbolize=1 if ASAN_EXTERNAL_SYMBOLIZER is defined
llvm-svn: 177036
This commit is contained in:
parent
0608ae89a2
commit
140cd84155
|
@ -130,11 +130,13 @@ static void ParseFlagsFromString(Flags *f, const char *str) {
|
|||
ParseFlag(str, &f->strict_memcmp, "strict_memcmp");
|
||||
}
|
||||
|
||||
static const char *asan_external_symbolizer;
|
||||
|
||||
void InitializeFlags(Flags *f, const char *env) {
|
||||
internal_memset(f, 0, sizeof(*f));
|
||||
|
||||
f->quarantine_size = (ASAN_LOW_MEMORY) ? 1UL << 26 : 1UL << 28;
|
||||
f->symbolize = false;
|
||||
f->symbolize = (asan_external_symbolizer != 0);
|
||||
f->verbosity = 0;
|
||||
f->redzone = ASAN_ALLOCATOR_VERSION == 2 ? 16 : (ASAN_LOW_MEMORY) ? 64 : 128;
|
||||
f->debug = false;
|
||||
|
@ -426,6 +428,8 @@ void __asan_init() {
|
|||
SetCheckFailedCallback(AsanCheckFailed);
|
||||
SetPrintfAndReportCallback(AppendToErrorMessageBuffer);
|
||||
|
||||
// Check if external symbolizer is defined before parsing the flags.
|
||||
asan_external_symbolizer = GetEnv("ASAN_SYMBOLIZER_PATH");
|
||||
// Initialize flags. This must be done early, because most of the
|
||||
// initialization steps look at flags().
|
||||
const char *options = GetEnv("ASAN_OPTIONS");
|
||||
|
@ -503,11 +507,9 @@ void __asan_init() {
|
|||
|
||||
InstallSignalHandlers();
|
||||
// Start symbolizer process if necessary.
|
||||
if (flags()->symbolize) {
|
||||
const char *external_symbolizer = GetEnv("ASAN_SYMBOLIZER_PATH");
|
||||
if (external_symbolizer) {
|
||||
InitializeExternalSymbolizer(external_symbolizer);
|
||||
}
|
||||
if (flags()->symbolize && asan_external_symbolizer &&
|
||||
asan_external_symbolizer[0]) {
|
||||
InitializeExternalSymbolizer(asan_external_symbolizer);
|
||||
}
|
||||
|
||||
// On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited
|
||||
|
|
Loading…
Reference in New Issue