public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: PR bootstrap/63888: [5 Regression] bootstrap failed when configured with -with-build-config=bootstrap-asan --disable-werror
@ 2014-11-15 19:53 H.J. Lu
  2014-11-17  8:00 ` Yury Gribov
  2014-11-17 22:19 ` Jeff Law
  0 siblings, 2 replies; 3+ messages in thread
From: H.J. Lu @ 2014-11-15 19:53 UTC (permalink / raw)
  To: gcc-patches

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.lu@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 \

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: PR bootstrap/63888: [5 Regression] bootstrap failed when configured with -with-build-config=bootstrap-asan --disable-werror
  2014-11-15 19:53 PATCH: PR bootstrap/63888: [5 Regression] bootstrap failed when configured with -with-build-config=bootstrap-asan --disable-werror H.J. Lu
@ 2014-11-17  8:00 ` Yury Gribov
  2014-11-17 22:19 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Yury Gribov @ 2014-11-17  8:00 UTC (permalink / raw)
  To: H.J. Lu, gcc-patches

On 11/15/2014 09:34 PM, H.J. Lu wrote:
> 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?

Right, I think until now everyone just did the same manually.  I wonder 
if it makes sense to also enable more aggressive checking e.g. 
detect_stack_use_after_return and check_initialization_order.

-Y

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: PR bootstrap/63888: [5 Regression] bootstrap failed when configured with -with-build-config=bootstrap-asan --disable-werror
  2014-11-15 19:53 PATCH: PR bootstrap/63888: [5 Regression] bootstrap failed when configured with -with-build-config=bootstrap-asan --disable-werror H.J. Lu
  2014-11-17  8:00 ` Yury Gribov
@ 2014-11-17 22:19 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2014-11-17 22:19 UTC (permalink / raw)
  To: H.J. Lu, gcc-patches

On 11/15/14 11:34, H.J. Lu wrote:
> 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.lu@intel.com>
>
> 	PR bootstrap/63888
> 	* bootstrap-asan.mk (ASAN_OPTIONS): Export "detect_leaks=0".
Ok.
jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-17 22:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-15 19:53 PATCH: PR bootstrap/63888: [5 Regression] bootstrap failed when configured with -with-build-config=bootstrap-asan --disable-werror H.J. Lu
2014-11-17  8:00 ` Yury Gribov
2014-11-17 22:19 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).