From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 1573A3858C3A for ; Tue, 9 Nov 2021 16:16:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1573A3858C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AF1D31E813; Tue, 9 Nov 2021 11:16:40 -0500 (EST) Subject: Re: [PATCH] gdb.debuginfod/fetch_src_and_symbols.exp: fix when GDB is built with AddressSanitizer To: Simon Marchi , gdb-patches@sourceware.org References: <20211104211412.22991-1-simon.marchi@efficios.com> From: Simon Marchi Message-ID: <574326f8-7939-7c0b-e9b5-c4704196a98f@simark.ca> Date: Tue, 9 Nov 2021 11:16:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211104211412.22991-1-simon.marchi@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, 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, 09 Nov 2021 16:16:42 -0000 On 2021-11-04 5:14 p.m., Simon Marchi via Gdb-patches wrote: > This test fails for me, showing: > > ERROR: tcl error sourcing /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp. > ERROR: This GDB was configured as follows: > configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu > --with-auto-load-dir=$debugdir:$datadir/auto-load > --with-auto-load-safe-path=$debugdir:$datadir/auto-load > ... and much more ... > > The problem is that TCL's exec throws an error as soon as the exec'ed > process outputs on stderr. When GDB is built with ASan, it prints some > warnings about pre-existing signal handlers: > > warning: Found custom handler for signal 7 (Bus error) preinstalled. > warning: Found custom handler for signal 8 (Floating point exception) preinstalled. > warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. > > Pass --quiet to GDB to avoid these warnings. > > Change-Id: I3751d89b9b1df646da19149d7cb86775e2d3e80f > --- > gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > index 92f3cd8b01d..31e9e4a92f0 100644 > --- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > +++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > @@ -30,8 +30,13 @@ if { [which curl] == 0 } { > } > > # Skip testing if gdb was not configured with debuginfod > +# > +# If GDB is built with ASan, it warns that some signal handlers (installed by > +# ASan) exist on startup. That makes TCL's exec throw an error. Disable that > +# by passing --quiet. > + > if { [string first "with-debuginfod" \ > - [eval exec $GDB $INTERNAL_GDBFLAGS --configuration]] == -1 } { > + [eval exec $GDB --quiet $INTERNAL_GDBFLAGS --configuration]] == -1 } { > untested "gdb not configured with debuginfod" > return -1 > } > -- > 2.33.0 > This is relatively obvious, I think, so I ended up pushing it. Simon