From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id C271E3858402 for ; Thu, 28 Sep 2023 20:57:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C271E3858402 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 A09401F45A; Thu, 28 Sep 2023 20:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695934636; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q1/KW/TJNDwkpxBVSDiG0rrlB5CbSZ8MlLNWfxtfvLg=; b=MaYB/jUr4bkpedLyINQMrM7Hge+qcHjbYPekP+6bz+r5B+LKonO2d9QTFu6/IDrciY4JBs FjxlAD0J7P0PyTFLL/t6J/SG6qb1Dz6/D3K6sSug2bpCZuJO2rZjy8dNtnd/EbHqgFbeqq VHLcKp40rHy37+8w9ahi0W+IplwcjFU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695934636; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q1/KW/TJNDwkpxBVSDiG0rrlB5CbSZ8MlLNWfxtfvLg=; b=HQejWKxFsGQJ4Mr8SO9xa+eb3QF5S7gOdvS3JRTeH3ANOy+k4bqKsdpAzhW/rQJQd0aM4f H3Bh9s2W4OX1ioBQ== 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 8D68813581; Thu, 28 Sep 2023 20:57:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ImBRIazoFWWoPwAAMHmgww (envelope-from ); Thu, 28 Sep 2023 20:57:16 +0000 Message-ID: Date: Thu, 28 Sep 2023 22:57:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] [gdb/tui] Fix segfault in tui_find_disassembly_address Content-Language: en-US To: Kevin Buettner , Tom de Vries via Gdb-patches References: <20230905150339.6452-1-tdevries@suse.de> <20230927091013.5b3a590d@f37-zws-nv> From: Tom de Vries In-Reply-To: <20230927091013.5b3a590d@f37-zws-nv> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,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 9/27/23 18:10, Kevin Buettner wrote: > Hi Tom, > > On Tue, 5 Sep 2023 17:03:38 +0200 > Tom de Vries via Gdb-patches wrote: > >> Fix the segfault by handling asm_lines.empty () results of tui_disassemble in >> tui_find_disassembly_address. >> >> I've written a unit test that exercises this scenario. >> >> Tested on x86_64-linux. >> >> PR tui/30823 >> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30823 > > I don't know this area very well, but your explanation and patch look > reasonable to me. > > Reviewed-by: Kevin Buettner Thanks for the review. I've committed this, but I now see there's a new warning: ... gdb/tui/tui-disasm.c: In function ‘CORE_ADDR tui_find_disassembly_address(gdbarch*, CORE_ADDR, int)’: gdb/tui/tui-disasm.c:293:7: warning: ‘last_addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (last_addr < pc) ^~ ... I'll take a look. Thanks, - Tom