From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mDTEHu3URmMlJQsAWB0awg (envelope-from ) for ; Wed, 12 Oct 2022 10:53:33 -0400 Received: by simark.ca (Postfix, from userid 112) id 7BCB91E112; Wed, 12 Oct 2022 10:53:33 -0400 (EDT) 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=qhh3lttG; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 31B081E0CB for ; Wed, 12 Oct 2022 10:53:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD0363851164 for ; Wed, 12 Oct 2022 14:53:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD0363851164 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665586412; bh=Kqos3H0GuNZHhVI57m72fbm+eDAiHD4ROVBW1XWAt3g=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qhh3lttGTtJDmGV8DVtTCXO90auirZJT0u85FDAwutYtzZXT3Tpu71dufmIgouZY+ Ju8hAMxt7yM+Yoam3vSHFPoLFMP/cG2UCXBsBNqg0vM65zV91cgKJGIncjOKBvxz5K UkxAnCZtwXuaINV3Z0yYZ2Van6xTANITQS7Oq+gk= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A2B193856089 for ; Wed, 12 Oct 2022 14:53:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2B193856089 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 48E861F85D for ; Wed, 12 Oct 2022 14:52:41 +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 3242613A5C for ; Wed, 12 Oct 2022 14:52:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1cZQCrnURmNXLgAAMHmgww (envelope-from ) for ; Wed, 12 Oct 2022 14:52:41 +0000 Date: Wed, 12 Oct 2022 16:52:39 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb] Fix assert in handle_jit_event Message-ID: <20221012145238.GA3706@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , 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" Hi, With the cc-with-tweaks.sh patch submitted here ( https://sourceware.org/pipermail/gdb-patches/2022-October/192586.html ) we run with: ... $ export STRIP_ARGS_STRIP_DEBUG=--strip-all $ make check RUNTESTFLAGS="gdb.base/jit-reader.exp \ --target_board cc-with-gnu-debuglink" ... into the following assert: ... (gdb) run ^M Starting program: jit-reader ^M gdb/jit.c:1247: internal-error: jit_event_handler: \ Assertion `jiter->jiter_data != nullptr' failed.^M ... Fix this by handling the jit_bp_sym.objfile->separate_debug_objfile_backlink != nullptr case in handle_jit_event. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29277 Any comments? Thanks, - Tom [gdb] Fix assert in handle_jit_event --- gdb/breakpoint.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index e9aee6315fa..902a9baa3e0 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5685,7 +5685,10 @@ handle_jit_event (CORE_ADDR address) function needs to be updated too. */ bound_minimal_symbol jit_bp_sym = lookup_minimal_symbol_by_pc (address); gdb_assert (jit_bp_sym.objfile != nullptr); - jit_event_handler (gdbarch, jit_bp_sym.objfile); + objfile *objfile = jit_bp_sym.objfile; + if (objfile->separate_debug_objfile_backlink) + objfile = objfile->separate_debug_objfile_backlink; + jit_event_handler (gdbarch, objfile); target_terminal::inferior (); }