From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 63A75385840D for ; Tue, 2 Nov 2021 20:34:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 63A75385840D X-ASG-Debug-ID: 1635885275-0c856e03888da230001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id Up3CewEtRySBGRoL (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 02 Nov 2021 16:34:35 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id 82187441D64; Tue, 2 Nov 2021 16:34:35 -0400 (EDT) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb/testsuite: set ASAN_OPTIONS=detect_leaks=0 while running tests Date: Tue, 2 Nov 2021 16:34:34 -0400 X-ASG-Orig-Subj: [PATCH] gdb/testsuite: set ASAN_OPTIONS=detect_leaks=0 while running tests Message-Id: <20211102203434.3889269-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1635885275 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1869 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.93694 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 02 Nov 2021 20:34:41 -0000 We see some additional failures when running the testsuite against a GDB compiled with ASan, compared to a GDB compiled without ASan. Some of them are caused by the memory leak report shown by the GDB process when it exits, and the fact that it makes it exit with a non-zero exit code. I generally try to remember to set ASAN_OPTIONS=detect_leaks=0 in my environment when running the tests, but I don't always do it. I think it would be nice if the testsuite did it. I don't see any use to have leak detection when running the tests. That is, unless we ever have a test that ensures GDB doesn't leak memory, which isn't going to happen any time soon. Here are some tests I found that were affected by this: gdb.base/batch-exit-status.exp gdb.base/many-headers.exp: read core file gdb.base/quit.exp gdb.base/with-mf.exp gdb.dwarf2/gdb-add-index.exp gdb.dwarf2/gdb-add-index-symlink.exp gdb.dwarf2/imported-unit-runto-main.exp Change-Id: I784c7df8a13979eb96587f735c1d33ba2cc6e0ca --- gdb/testsuite/lib/gdb.exp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 7f02504262d..97bedd5cb58 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -25,6 +25,13 @@ 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" + # List of procs to run in gdb_finish. set gdb_finish_hooks [list] -- 2.33.0