From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lnpKL7Y+5mjN/iMAWB0awg (envelope-from ) for ; Wed, 08 Oct 2025 06:36:38 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=STyfGhZf; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aoJMe7RK; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=STyfGhZf; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aoJMe7RK; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B2C4E1E047; Wed, 08 Oct 2025 06:36:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 79C081E047 for ; Wed, 08 Oct 2025 06:36:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C6CB3385734F for ; Wed, 8 Oct 2025 10:36:36 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id D2175385C6F7 for ; Wed, 8 Oct 2025 10:36:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2175385C6F7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D2175385C6F7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1759919769; cv=none; b=FZfpb5JxkSchpIxhHetp2cW0TsougTzkyJDJoLjErgJGTyV+FdYFc2HGkdb5Owaqf3gg7yIZya/uWekXQhAn27z5Qnz5sPBPKmHdn9iodkwzEFoeHXXzw+AE7AsDOapq5v+ed87gzYtumY4P97LfQiTZAdfCKXlVYReW9op+GGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1759919769; c=relaxed/simple; bh=T2LCDm1DZ2U/2Jbpv2dl2y3CE4I/1dbsK/Rcf4myNzc=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=n6VOBVPVmeh3IQ8+EW9DD8f5JDDPqae+0hsUMXa0gpqyT/C2WB3Lh5eBnT34elz+lMp2DqklczpbhD8BDIM7v2D0PRBGvO8FwEP1bQ7Zz03oujKDJg1eGSF+a6Vd68yIL/4Um/m/XC125IA+Mpcr/bU2f/cvDYkGSvKs8neET5s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6CB171F7C2; Wed, 8 Oct 2025 10:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1759919768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bxrd9LgQ0ZRj6ATSYLaq27fjiPnHvEObWWHBROORKew=; b=STyfGhZfGF4vAWqPvifOKypgdd9u6UutnjNLnLyMmTuHDzyYs5sQGyaCkHIM7svL4I6yh4 UKgq7ixGr6saI7EDKGiby4/LPNx+xPmiwcDE9iSNGMixQDXYmaw8HX/xNpV6Vg+4fBk/Yd gFLnY/QsJcRJg7IhVccWSxKrCH5NLp4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1759919768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bxrd9LgQ0ZRj6ATSYLaq27fjiPnHvEObWWHBROORKew=; b=aoJMe7RK3iVEx3deEW2oiCg2HfMt9uio0sPBYgXMBEUWR5L9ZC7v8lRR2rP+AqkVenDnEW /hG9TmHOqFj0b2CA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1759919768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bxrd9LgQ0ZRj6ATSYLaq27fjiPnHvEObWWHBROORKew=; b=STyfGhZfGF4vAWqPvifOKypgdd9u6UutnjNLnLyMmTuHDzyYs5sQGyaCkHIM7svL4I6yh4 UKgq7ixGr6saI7EDKGiby4/LPNx+xPmiwcDE9iSNGMixQDXYmaw8HX/xNpV6Vg+4fBk/Yd gFLnY/QsJcRJg7IhVccWSxKrCH5NLp4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1759919768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bxrd9LgQ0ZRj6ATSYLaq27fjiPnHvEObWWHBROORKew=; b=aoJMe7RK3iVEx3deEW2oiCg2HfMt9uio0sPBYgXMBEUWR5L9ZC7v8lRR2rP+AqkVenDnEW /hG9TmHOqFj0b2CA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 51CAF13693; Wed, 8 Oct 2025 10:36:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8pG2Epg+5mh5FwAAD6G6ig (envelope-from ); Wed, 08 Oct 2025 10:36:08 +0000 Message-ID: Date: Wed, 8 Oct 2025 12:36:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv2 3/3] gdb/python: add Corefile.mapped_files method To: Andrew Burgess , Tom Tromey Cc: gdb-patches@sourceware.org References: <9ab589510f784da2752b72d0b1385afa33aca406.1758634958.git.aburgess@redhat.com> <87cy737q50.fsf@tromey.com> <87zfa26gxp.fsf@redhat.com> <87o6qi6dwn.fsf@redhat.com> <87jz166al5.fsf@redhat.com> <3996ddc9-2cb4-4ead-8895-5d6b27b5a72c@suse.de> <87bjmi65h4.fsf@redhat.com> <874is968sb.fsf@redhat.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <874is968sb.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_TWO(0.00)[2]; URIBL_BLOCKED(0.00)[sourceware.org:url,imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid, suse.de:email, imap1.dmz-prg2.suse.org:helo] 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: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 10/8/25 11:29, Andrew Burgess wrote: > Andrew Burgess writes: > >> Tom de Vries writes: >> >>> On 10/7/25 16:38, Andrew Burgess wrote: >>>> Andrew Burgess writes: >>>> >>>>> >>>>> Thanks for the diagnostic help. I'll work on improving the test to try >>>>> and catch these cases. If that works, then we might be able to adopt >>>>> this to help with other tests. Keeping this in mind, I'll add helper >>>>> functions to lib/gdb.exp. >>>> >>>> Hi Tom, >>>> >>>> At your leisure, could you check that the patch below resolves the FAIL >>>> you reported please. >>>> >>> >>> Hi Andrew, >>> >>> on Leap 15.6, yes. >>> >>> On Tumbleweed, unfortunately no. >> >> >> >>> (gdb) PASS: gdb.python/py-corefile.exp: test mapped files data: capture Python based mappings data >>> shell diff -s /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-1.txt /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-2.txt >>> Files /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-1.txt and /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile-out-2.txt are identical >>> (gdb) PASS: gdb.python/py-corefile.exp: test mapped files data: diff input and output one >>> show-build-ids >>> Objfile Build-Id Core File Build-Id File Name >>> 91c6abb593a519ecd18e543eaac25f913999b230 91c6abb593a519ecd18e543eaac25f913999b230 /data/vries/gdb/tumbleweed-20251005/build/gdb/testsuite/outputs/gdb.python/py-corefile/py-corefile >>> Python Exception : 'corefile' >>> Error occurred in Python: 'corefile' >> >> It looks like there's an objfile discovered via >> Inferior.progspace.objfiles(), which doesn't correspond to a file mapped >> into the core file. FYI, I only consider objfiles that are _actual_ >> files, so ignore things like [vdso], etc, and I only consider objfiles >> with a build-id. I figured that everything meeting this specification >> had to be something that would appear in the core file... >> >> The patch below will make the show-build-ids command a little more >> resilient, when a file is missing it'll print "missing" in the column >> now, rather than throwing the KeyError. >> >> My guess is we'll find the same file under different names maybe? > > Just to follow up, I setup a Tumbleweed VM. I was able to reproduce the > original issue you reported, but for me, the patch I posted[1] resolves > the issue. > > If you apply the snippet from [2] this should avoid the KeyError > exception, and should allow us to debug the problem. > Hi Andrew, thanks for following up on this. I put the gdb.log for Leap 15.6 and Tumbleweed side by side, and noticed that the difference was presence of glibc debuginfo (in the form of separate debug info objfiles). After doing "zypper install glibc-debuginfo" I could reproduce the FAIL on Leap 15.6. And after doing "dnf debuginfo-install glibc" in a fedora rawhide container, it also reproduced there. This fixes it for me in all those 3 cases: ... diff --git a/gdb/testsuite/gdb.python/py-corefile.py b/gdb/testsuite/gdb.pyt hon/py-corefile.py index 01665ef0395..bc8082733bf 100644 --- a/gdb/testsuite/gdb.python/py-corefile.py +++ b/gdb/testsuite/gdb.python/py-corefile.py @@ -106,7 +106,7 @@ class ShowBuildIds(gdb.Command): longest_build_id = 18 for o in objfiles: - if not o.is_file or o.build_id is None: + if not o.is_file or o.build_id is None or o.owner is not None: continue p = pathlib.Path(o.filename).resolve() b = o.build_id ... Thanks, - Tom > Thanks, > Andrew > > [1] https://inbox.sourceware.org/gdb-patches/87jz166al5.fsf@redhat.com > [1] https://inbox.sourceware.org/gdb-patches/87bjmi65h4.fsf@redhat.com >