From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id E9A3F3858D39 for ; Wed, 19 Oct 2022 15:42:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9A3F3858D39 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-out1.suse.de (Postfix) with ESMTPS id E550F21E76 for ; Wed, 19 Oct 2022 15:42:58 +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 D4AF713345 for ; Wed, 19 Oct 2022 15:42:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0qZRLgIbUGNyVwAAMHmgww (envelope-from ) for ; Wed, 19 Oct 2022 15:42:58 +0000 Message-ID: <875d8d79-c30b-d5b2-a619-3865add45308@suse.de> Date: Wed, 19 Oct 2022 17:42:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: [committed][gdb] Fix assert in handle_jit_event Content-Language: en-US From: Tom de Vries To: gdb-patches@sourceware.org References: <20221012145238.GA3706@delia.home> In-Reply-To: <20221012145238.GA3706@delia.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2022 15:43:24 -0000 On 10/12/22 16:52, Tom de Vries wrote: > 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? > Committed. 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 (); > }