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 969F43858D20 for ; Sun, 20 Nov 2022 19:34:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 969F43858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 2EDD41E0CB; Sun, 20 Nov 2022 14:34:32 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1668972872; bh=IJdZRYXNfjhMh9kX+bEViKweTk8+E/WYTE9qR+RbrVw=; h=Date:Subject:To:References:From:In-Reply-To:From; b=dTKcQvaPFRuRIk4UjE7PLPpN5kfHKExqkX/hnvMHvl+tvTMsowj0icIg+anMZhGSL 8STQi23spLyVuECBCoDnxW+SnrJNYVqaVeWedaVLCvadLAfJ73Dyjt3OaaTpnbkFyr xw5q9NVekHt+V34FiwazJ31JuAW1RajzVE57u+CU= Message-ID: <5464181b-9de6-c242-cdac-58efbf262437@simark.ca> Date: Sun, 20 Nov 2022 14:34:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [RFA] When getting the locno of a bpstat, handle the case of bp with null locations. Content-Language: en-US To: Philippe Waroquiers , gdb-patches@sourceware.org References: <20221120173024.3647464-1-philippe.waroquiers@skynet.be> From: Simon Marchi In-Reply-To: <20221120173024.3647464-1-philippe.waroquiers@skynet.be> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/20/22 12:30, Philippe Waroquiers via Gdb-patches wrote: > The test py-objfile.exp unloads the current file while debugging the process. > This results in bpstat bs->b->loc to become nullptr. > Handle this case in breakpoint.c:bpstat_locno. > > Note: GDB crashes on this problem with an internal error, > but the end of gdb summary shows: > ... > === gdb Summary === > > # of expected passes 36 > > The output also does not contain a 'FAIL:'. > After the dix, the nr of expeted passes increased. > > In the gdb.log output, one can see: > ... > Fatal signal: Segmentation fault > ----- Backtrace ----- > 0x55698905c5b9 gdb_internal_backtrace_1 > ../../binutils-gdb/gdb/bt-utils.c:122 > 0x55698905c5b9 _Z22gdb_internal_backtracev > ... > > ERROR: Couldn't send python print(objfile.filename) to GDB. > ERROR: : spawn id exp9 not open > while executing > "expect { > -i exp9 -timeout 10 > -re ".*A problem internal to GDB has been detected" { > fail "$message (GDB internal error)" > gdb_internal_error..." > ("uplevel" body line 1) > invoked from within > .... > > Wondering if it might be possible to improve gdb_test to have > gdb_test "python print(objfile.filename)" "None" \ > "objfile.filename after objfile is unloaded" > reporting a failed result instead of just producing the internal error. I ran the testsuite with the patch applied, I saw these unexpected failures when running with native-gdbserver or native-extended-gdbserver: FAIL: gdb.base/step-over-syscall.exp: detach-on-fork=off: follow-fork=parent: break cond on target : fork: continue to marker FAIL: gdb.base/step-over-syscall.exp: detach-on-fork=off: follow-fork=child: break cond on target : fork: continue to marker I bisected, and it pointed to the locno patch again. Probably the expected patterns that need to be updated? continue^M Continuing.^M [New inferior 2 (process 1262224)]^M ^M Thread 1.1 "step-over-fork" hit Breakpoint 4.1, marker () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/step-over-fork.c:22^M 22 marker () {}^M (gdb) FAIL: gdb.base/step-over-syscall.exp: detach-on-fork=off: follow-fork=parent: break cond on target : fork: continue to marker However, I confirm it gets rid of the UNRESOLVEDs due to the ASan complaints. But I don't have time to look at the code right now, sorry. Simon