From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eMAEMU5rzWJ5TREAWB0awg (envelope-from ) for ; Tue, 12 Jul 2022 08:38:38 -0400 Received: by simark.ca (Postfix, from userid 112) id C6A661E5EA; Tue, 12 Jul 2022 08:38:38 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QNVebhZq; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4029C1E21F for ; Tue, 12 Jul 2022 08:38:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A5CB5383A371 for ; Tue, 12 Jul 2022 12:38:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5CB5383A371 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657629517; bh=GrGBwOqLObRWXOrZb7JfOn8fYu0ThW3Ut8XYfu0LbMk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=QNVebhZqswLnRm488tW0PXtRGZqQR0nHn26WTvoeSzcDqBq6giPs3V0JLKyYYkObe 1OfN+GRYMafQSzo/3bEdf6UrsHg6ep/2hMzoh8xc1vIQ4oN5B4xk5hDEvxEC3Y/atR 4WC6GZX4Dbh3emk5tmFXrkKLmTjinNuruZ8gTdUA= Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id C5D413857C5B for ; Tue, 12 Jul 2022 12:38:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C5D413857C5B Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 13A3C2007E; Tue, 12 Jul 2022 12:38:18 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F171713638; Tue, 12 Jul 2022 12:38:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id D2qbOTlrzWKbKwAAMHmgww (envelope-from ); Tue, 12 Jul 2022 12:38:17 +0000 Date: Tue, 12 Jul 2022 14:38:16 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Allow override of ASAN_OPTIONS in lib/gdb.exp Message-ID: <20220712123814.GA19876@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, Use set_sanitizer_default for ASAN_OPTIONS in lib/gdb.exp. This allows us to override the default detect_leaks=0 setting, by manually doing: ... $ export ASAN_OPTIONS=detect_leaks=1 $ make check ... Tested on x86_64-linux, by building with -fsanitize=address and running test-case gdb.dwarf2/gdb-add-index.exp with and without "export ASAN_OPTIONS=detect_leaks=1". Any comments? Thanks, - Tom [gdb/testsuite] Allow override of ASAN_OPTIONS in lib/gdb.exp --- gdb/testsuite/lib/gdb.exp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 698dd14504e..a8f25b5f0dd 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -25,13 +25,6 @@ if {$tool == ""} { exit 2 } -# If GDB is built with ASAN (and because there are leaks), it will output a -# leak report when exiting as well as exit with a non-zero (failure) status. -# This can affect tests that are sensitive to what GDB prints on stderr or its -# exit status. Add `detect_leaks=0` to the ASAN_OPTIONS environment variable -# (which will affect any spawned sub-process) to avoid this. -append ::env(ASAN_OPTIONS) ",detect_leaks=0" - # Add VAR_ID=VAL to ENV_VAR, unless ENV_VAR already contains a VAR_ID setting. proc set_sanitizer_default { env_var var_id val } { @@ -58,6 +51,13 @@ proc set_sanitizer_default { env_var var_id val } { set_sanitizer_default TSAN_OPTIONS suppressions \ $srcdir/../tsan-suppressions.txt +# If GDB is built with ASAN (and because there are leaks), it will output a +# leak report when exiting as well as exit with a non-zero (failure) status. +# This can affect tests that are sensitive to what GDB prints on stderr or its +# exit status. Add `detect_leaks=0` to the ASAN_OPTIONS environment variable +# (which will affect any spawned sub-process) to avoid this. +set_sanitizer_default ASAN_OPTIONS detect_leaks 0 + # List of procs to run in gdb_finish. set gdb_finish_hooks [list]