From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UuyEOYnu+Gd5ky8AWB0awg (envelope-from ) for ; Fri, 11 Apr 2025 06:27:21 -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=pBbfHp44; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=S5coG0Aq; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=A3TB9TTo; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3De6AmIa; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D97481E0C3; Fri, 11 Apr 2025 06:27:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.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 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 E33D71E05C for ; Fri, 11 Apr 2025 06:27:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 803863831E15 for ; Fri, 11 Apr 2025 10:27:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 803863831E15 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pBbfHp44; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=S5coG0Aq; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=A3TB9TTo; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3De6AmIa Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 3A817383303A for ; Fri, 11 Apr 2025 10:26:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A817383303A 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 3A817383303A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744367187; cv=none; b=nHCBYqvYZ8KUFEERt4NxFQwnFyn8HUMou3G/NQOCL0tpOI9+6MC6AO9ekTYVDlcYvXcTrJwEtze7Ly65f/pgyEAh2D6VI6vn7zjoz59MM661Tdy0jGfjDOnZ2TJy68HK6VwUQ+eSGrMZ0jzP/bVLmkX3TedvVwCk3rGSp/zWG9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744367187; c=relaxed/simple; bh=KGNB7cAkpP4+jIwFYwCgKBF49f5+OFB5FHhDDNl/6a8=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=bdWQ6uziKvcpPmUJZX6+TLOsBpfLNdAso4y2kHEC4Sew+c10sxtle8HyeDR22TWaQLAAIC9RxYAaXIhv+yCoTx6zq0Vd/D36jJp3vY5dGGWoVTAjcRDnt4RUJncDYHeO2D3Zfyr50sWO6SV6vWGeRk1TqIpP/jSiScVIqD+Isr0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A817383303A Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out1.suse.de (Postfix) with ESMTPS id 49D1B2111F; Fri, 11 Apr 2025 10:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744367186; 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=b/Bi7ZkdRrfoGq7zWyR4YSeCVgB++xJ4gQMX3odWbwg=; b=pBbfHp44m798KtRg0xwUZ+Sflhuk36sz8duH53bgGdY8P5h8ISY0zhToiwToljDoNF+HH9 iepSdhYPyrNiMiEJ6KzU1JSOItFR3t9isXEaI/1HhMkzHruf8O62DengaTzRC0dgnIA/WZ m1XvpI/Z+Rx81XlM1ud8ZEgC2x/CDk8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744367186; 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=b/Bi7ZkdRrfoGq7zWyR4YSeCVgB++xJ4gQMX3odWbwg=; b=S5coG0AqRHbW52417w2ZEkBYf+Egi8fm99HEVSNb/aJlFzVNE61anWVXuF08p6zCM1Hx23 lEVwcw7eHECJjPCg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=A3TB9TTo; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=3De6AmIa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744367185; 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=b/Bi7ZkdRrfoGq7zWyR4YSeCVgB++xJ4gQMX3odWbwg=; b=A3TB9TTovVrO0gnhxn1n+R08yzlQQ25n4dYGe/tQf5pGNBjRMhBvVDhcTdT8hZyoOk1Rgh 1GZpLmFmj22+phYFFJI97gsDbmImQahPKOVCJegi6ehbg4fOiri8E+itFXfa/rFJO7RXHM yfu7zDHHErQ85ALrfBRmJvrD8Ex7t3Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744367185; 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=b/Bi7ZkdRrfoGq7zWyR4YSeCVgB++xJ4gQMX3odWbwg=; b=3De6AmIas1PbDy+JwJHXgzEDyD07OnZDDtjUD75AqwhZC9jqayyDY0PlQ/13oWkk9S/0BF iKu5L0/sE2KckwDA== 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 2AAA6136A4; Fri, 11 Apr 2025 10:26:25 +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 99GMCFHu+GfZOAAAD6G6ig (envelope-from ); Fri, 11 Apr 2025 10:26:25 +0000 Message-ID: Date: Fri, 11 Apr 2025 12:26:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] gdb/testsuite: fix gdb.base/dlmopen-ns-ids.exp racy test To: Guinevere Larsen , gdb-patches@sourceware.org References: <20250409182510.1629742-1-guinevere@redhat.com> <20250410130148.1880139-1-guinevere@redhat.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <20250410130148.1880139-1-guinevere@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49D1B2111F X-Rspamd-Action: no action X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; ASN(0.00)[asn:25478, ipnet:::/0, country:RU]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns, imap1.dmz-prg2.suse.org:helo, suse.de:dkim, suse.de:mid, suse.de:email] X-Rspamd-Server: rspamd1.dmz-prg2.suse.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: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 4/10/25 15:01, Guinevere Larsen wrote: > The recently included gdb.base/dlmopen-ns-ids.exp test can sometimes > fail the call to get_integer_valueof when trying to check the namespace > ID of the fourth dlopened SO, for apparently no reason. > > What's happening is that the call to get_first_so_ns doesn't necessarily > consume the GDB prompt, and so get_integer_valueof will see the prompt > immediately and not find the value the test is looking for. > > To fix this, the test was changed so that we consume all of the output > of the command "info sharedlibrary", but only set the namespace ID for > the first occurence of the SO we're looking for. The command now also > gets the solib name as a parameter, to reduce the amount of output. > Hi Gwen, LGTM. I've also ran it through make-check-all.sh, and found no issues. I did notice a typo, and indeed, the proposed codespell-log check confirmed it ( https://sourceware.org/pipermail/gdb-patches/2025-April/217118.html ): ... codespell-log............................................................Passed - hook id: codespell-log - duration: 0.19s codespell-log-internal...................................................Failed - hook id: codespell - exit code: 65 .git/COMMIT_EDITMSG:13: occurence ==> occurrence ... OK with that fixed. Approved-By: Tom de Vries FWIW, I don't much like the style of regexp used, I find it hard to parse. I prefer something more spaced out and less escape-heavy, like: ... set re1 [list "From" "To" "(NS" ")?Syms" "Read" "Shared Object Library"] set re1 [join $re1 {\s+}] set re_ns [list {\[\[} ($::decimal) {\]\]}] set re_ns [join $re_ns ""] set re2 [list "$::hex" "$::hex" $re_ns "\[^\r\n]+${lib_regexp}"] set re2 [join $re2 {\s+}] ... But that's a pre-exising style issue, so I suppose it's better to not address this in this bug-fix commit. Thanks, - Tom > Co-Authored-By: tdevries@suse.de > --- > gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp > index 03b7a527af5..3ddc07e7773 100644 > --- a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp > +++ b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp > @@ -24,7 +24,8 @@ require allow_dlmopen_tests > standard_testfile -main.c -lib.c > > set srcfile_lib $srcfile2 > -set binfile_lib [standard_output_file dlmopen-lib.so] > +set so_name dlmopen-lib.so > +set binfile_lib [standard_output_file $so_name] > > if { [build_executable "build shlib" $binfile_lib $srcfile_lib \ > [list debug shlib]] == -1 } { > @@ -41,18 +42,19 @@ if { [build_executable "failed to build" $testfile $srcfile \ > # for the so > proc get_first_so_ns {} { > set ns -1 > - gdb_test_multiple "info sharedlibrary" "get SO namespace" -lbl { > - -re "From\\s+To\\s+\(NS\\s+\)?Syms\\s+Read\\s+Shared Object Library\r\n" { > + set lib_regexp [string_to_regexp ${::binfile_lib}] > + gdb_test_multiple "info sharedlibrary $::so_name" "get SO namespace" -lbl { > + -re "\r\nFrom\\s+To\\s+\(NS\\s+\)?Syms\\s+Read\\s+Shared Object Library(?=\r\n)" { > exp_continue > } > - -re "^$::hex\\s+$::hex\\s+\\\[\\\[($::decimal)\\\]\\\]\\s+\[^\r\n]+$::binfile_lib.*" { > - set ns $expect_out(1,string) > - } > - -re "^$::gdb_prompt $" { > - } > - -re "^\[^\r\n\]+\r\n" { > + -re "\r\n$::hex\\s+$::hex\\s+\\\[\\\[($::decimal)\\\]\\\]\\s+\[^\r\n]+${lib_regexp}(?=\r\n)" { > + if {$ns == -1} { > + set ns $expect_out(1,string) > + } > exp_continue > } > + -re -wrap "" { > + } > } > return $ns > } > > base-commit: d1458933830456e54223d9fc61f0d9b3a19256f5