From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9Q+zLMLoFWXimB8AWB0awg (envelope-from ) for ; Thu, 28 Sep 2023 16:57:38 -0400 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=hqymFuIv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id ADFFD1E0C3; Thu, 28 Sep 2023 16:57:38 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9F29D1E092 for ; Thu, 28 Sep 2023 16:57:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F7F03861813 for ; Thu, 28 Sep 2023 20:57:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F7F03861813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695934656; bh=q1/KW/TJNDwkpxBVSDiG0rrlB5CbSZ8MlLNWfxtfvLg=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hqymFuIvcBgsdfMndT5zedvWf86KYmY4YVdFS7Gfxm2ISN/PcjD+vtZ+K30MuT6G6 +lfUy3gyHl4l9mg5Rg83iUHP6VREm0ArO9ra/S84knm1MONvxdnE1ayoRU+qiOh77S WXU6DnpyY2AM8DbiYDDecLKarMRq9rk6ITlPKc28= 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 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) 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> 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 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" 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