Hi,

GCC uses xstrndup/xstrdup throughout the source tree and those memory
may not be freed explicitly before exut.  LeakSanitizer isn't very
useful here.  This patch suppresses LeakSanitizer in bootstrap.  OK
for trunk?

This patch isn't sufficient.  I got

configure:3612: /export/build/gnu/gcc-asan/build-x86_64-linux/./gcc/xgcc
-B/export/build/gnu/gcc-asan/build-x86_64-linux/./gcc/
-B/usr/gcc-5.0.0/x86_64-unknown-linux-gnu/bin/
-B/usr/gcc-5.0.0/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/gcc-5.0.0/x86_64-unknown-linux-gnu/include -isystem
/usr/gcc-5.0.0/x86_64-unknown-linux-gnu/sys-include    -c -g -O2
conftest.c >&5
=================================================================
==14370==ERROR: AddressSanitizer: odr-violation (0x000002b38aa0):
  [1] size=12 'CSWTCH.2819'
/export/gnu/import/git/sources/gcc/gcc/tree-vrp.c:4056:7
  [2] size=12 'CSWTCH.2820'
/export/gnu/import/git/sources/gcc/gcc/tree-vrp.c:4109:8
These globals were registered at these points:
  [1]:
    #0 0x68e9c6 in __asan_register_globals
/export/gnu/import/git/sources/gcc/libsanitizer/asan/asan_globals.cc:217
    #1 0x28dc89c in __libc_csu_init
(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0x28dc89c)
    #2 0x309e821c34 in __libc_start_main (/lib64/libc.so.6+0x309e821c34)
    #3 0x683d3e
(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0x683d3e)

  [2]:
    #0 0x68e9c6 in __asan_register_globals
/export/gnu/import/git/sources/gcc/libsanitizer/asan/asan_globals.cc:217
    #1 0x28dc89c in __libc_csu_init
(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0x28dc89c)
    #2 0x309e821c34 in __libc_start_main (/lib64/libc.so.6+0x309e821c34)
    #3 0x683d3e
(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0x683d3e)

==14370==HINT: if you don't care about these warnings you may set
ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'CSWTCH.2819' at
/export/gnu/import/git/sources/gcc/gcc/tree-vrp.c:4056:7
==14370==ABORTING



H.J.
---
2014-11-15  H.J. Lu  <hongjiu...@intel.com>

        PR bootstrap/63888
        * bootstrap-asan.mk (ASAN_OPTIONS): Export "detect_leaks=0".

diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk
index fbef021..52ef30e 100644
--- a/config/bootstrap-asan.mk
+++ b/config/bootstrap-asan.mk
@@ -1,5 +1,8 @@
 # This option enables -fsanitize=address for stage2 and stage3.
 
+# Suppress LeakSanitizer in bootstrap.
+export ASAN_OPTIONS="detect_leaks=0"
+
 STAGE2_CFLAGS += -fsanitize=address
 STAGE3_CFLAGS += -fsanitize=address
 POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \

Reply via email to