From unknown Sat Aug 09 05:04:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#70226] [PATCH] scripts: package: Disable searching with the empty string Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 06 Apr 2024 01:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70226 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70226@debbugs.gnu.org Cc: Richard Sent , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.17123658653378 (code B ref -1); Sat, 06 Apr 2024 01:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Apr 2024 01:11:05 +0000 Received: from localhost ([127.0.0.1]:37835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsuaG-0000sP-RI for submit@debbugs.gnu.org; Fri, 05 Apr 2024 21:11:05 -0400 Received: from lists.gnu.org ([2001:470:142::17]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsuaB-0000rE-RU for submit@debbugs.gnu.org; Fri, 05 Apr 2024 21:11:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsua0-0003nr-2w for guix-patches@gnu.org; Fri, 05 Apr 2024 21:10:48 -0400 Received: from mail-108-mta226.mxroute.com ([136.175.108.226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsuZx-0000Df-QG for guix-patches@gnu.org; Fri, 05 Apr 2024 21:10:47 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta226.mxroute.com (ZoneMTA) with ESMTPSA id 18eb0f5225e0003bea.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 06 Apr 2024 01:10:38 +0000 X-Zone-Loop: d2f5586ca985caaf9756db1ce590ab98a8dd92a91c90 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6feALBtLJyjd7h0Je59eHFatwcz6OS7HYOkpa80q/h0=; b=ZbIzjW+1amsy0o6trpgaZ5W9ps oXqQQQZOQch9nObNrZvuyg6oiwMpvoDg2wxJ0jnV4Rvgou8lTnneW4l22TRJ1s/J42fX604anmF8k uPYN6eMMsvzQ9qOzmHrEKSV3IYXjC54+l7XNZ8eBcTvsIXDqO/wL9pX/ve6EWVINnkJ+7YVXwXN8m VCbnKENf6796a2kTt2RdakUXBx0K1Uq5AkEWrSkTgu1FN146nUGzfchJQDCEQxt4I2z6Ry3EiN1y1 bd28U3Yn+auoA6Q35M2E/h7MFctwkQjI/Ia0gDu/htTgT1dfJmJ27lie4gljzlkzmtg9YsUKvARm3 3uP5gGaw==; From: Richard Sent Date: Fri, 5 Apr 2024 21:05:53 -0400 Message-ID: <64c782009b2c286cc72513a4a7735bbad650052f.1712365552.git.richard@freakingpenguin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.226; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta226.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) Reported in . * guix/scripts/package.scm (process-query): search operating no longer passes empty strings to make-regexp to avoid unbounded memory usage. Change-Id: I8194591f0428c4f88fb101c0226b98f593a55709 --- Hi Guix! Not sure of the usefulness of small patches like this, but figure it gives me an excuse to trawl the repo and it's better to send it and not be needed than the inverse. I considered adding a --force flag to forcefully allow "" searches, but since multiple scripts use package.scm and there's a lot of CLI flags already it didn't seem appropriate to add another one, particularly if it just results in a system freeze. guix/scripts/package.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index a489e06e73..66e5384ddc 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -891,6 +891,8 @@ (define (process-query opts) (('search _) (let* ((patterns (filter-map (match-lambda + ;; https://issues.guix.gnu.org/70223 + (('query 'search "") #f) (('query 'search rx) rx) (_ #f)) opts)) base-commit: 886ed061d7c57eb9d707b2af2c87402b86becf70 -- 2.41.0 From unknown Sat Aug 09 05:04:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#70226] Fwd: I haven't been able to trigger this bug In-Reply-To: <64c782009b2c286cc72513a4a7735bbad650052f.1712365552.git.richard@freakingpenguin.com> Resent-From: Dale Mellor Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 Apr 2024 17:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70226 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70226@debbugs.gnu.org Received: via spool by 70226-submit@debbugs.gnu.org id=B70226.171449971025944 (code B ref 70226); Tue, 30 Apr 2024 17:56:03 +0000 Received: (at 70226) by debbugs.gnu.org; 30 Apr 2024 17:55:10 +0000 Received: from localhost ([127.0.0.1]:60647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1rh8-0006kO-L9 for submit@debbugs.gnu.org; Tue, 30 Apr 2024 13:55:10 -0400 Received: from [195.15.247.228] (port=8860 helo=rdmp.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1rh7-0006kI-2S for 70226@debbugs.gnu.org; Tue, 30 Apr 2024 13:55:09 -0400 Received: from [127.0.0.1] (helo=[IPv6:::1]) by rdmp.org with esmtp (Exim 4.96.1) (envelope-from ) id 1s1rge-0006jV-38 for 70226@debbugs.gnu.org; Tue, 30 Apr 2024 17:54:41 +0000 Message-ID: <7138c2308cad21abb86f0ef0095904a9b4030c1a.camel@rdmp.org> From: Dale Mellor Date: Tue, 30 Apr 2024 18:54:40 +0100 References: Organization: DM Bespoke Computer Solutions Ltd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Can you give a command-line use-case which actually triggers this bug? Thanks. Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) Can you give a command-line use-case which actually triggers this bug? Thanks. From unknown Sat Aug 09 05:04:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#70226] Fwd: I haven't been able to trigger this bug Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 Apr 2024 20:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70226 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Dale Mellor Cc: 70226@debbugs.gnu.org Received: via spool by 70226-submit@debbugs.gnu.org id=B70226.171450844632429 (code B ref 70226); Tue, 30 Apr 2024 20:21:02 +0000 Received: (at 70226) by debbugs.gnu.org; 30 Apr 2024 20:20:46 +0000 Received: from localhost ([127.0.0.1]:33074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1ty2-0008Qz-D6 for submit@debbugs.gnu.org; Tue, 30 Apr 2024 16:20:46 -0400 Received: from mail-108-mta155.mxroute.com ([136.175.108.155]:33731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1txx-0008Qt-0f for 70226@debbugs.gnu.org; Tue, 30 Apr 2024 16:20:44 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta155.mxroute.com (ZoneMTA) with ESMTPSA id 18f30aa4d430008ca2.001 for <70226@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 30 Apr 2024 20:20:18 +0000 X-Zone-Loop: 554609b77a63aae11174827120bdd93e81c6c16ffd6f X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8gab/+UBmMgOkdXROpJ5FC5BXV7iSN/Iyw9vjCNld+0=; b=jyd6daLJRWSvCNRiofUvzoZtPL GFffgZELXoOyEBSm52O1pqYMDUIplLUdRHHbsoAF4SYhFgv86cp59EfTnaHtSwQM8GYr8AW6ybAlu zXfgzPHj3BwCpnYSzU2H4GtiyZz5PqNowu0jA0mgGZ6l7nLMdF92qTmLwF5VC4h8PoLCNYwP1kCoj Mt+R6kuSvx2zaD2DtuMY5cJ6yMpIxFNwj/XnVVVKeQ9wqPzVR1whiTtCHSrhL2S58qEgvhlipQc6N Mx0JdFnhu1SyGvWLsM0IxwY7PkQKFZzgV+V+a0ks0UfrqeiZeHrUHo22176kzxFd9W3Y+ERFeAuQa esWuks7Q==; From: Richard Sent In-Reply-To: <7138c2308cad21abb86f0ef0095904a9b4030c1a.camel@rdmp.org> (Dale Mellor's message of "Tue, 30 Apr 2024 18:54:40 +0100") References: <7138c2308cad21abb86f0ef0095904a9b4030c1a.camel@rdmp.org> Date: Tue, 30 Apr 2024 16:20:10 -0400 Message-ID: <87edamd2md.fsf@freakingpenguin.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi! Dale Mellor writes: > Can you give a command-line use-case which actually triggers this bug? Certainly. I've replicated this issue on guix a1ffa8a with: $ guix search "" $ guix system search "" $ guix home search "" guix search "" takes ~30 seconds before the bug occurs. (Once the first result is printed to stdout.) system search and home search are basically instant. That's probably due to the smaller pool of candidates. Working on this a bit more the problem isn't the regex search itself. Instead, I'm confident it has to do with the highlighting performed by display-search-results when passed a list containing a "" regex. The issue does not occur for system search with just the following diff: --8<---------------cut here---------------start------------->8--- modified guix/scripts/system/search.scm @@ -189,5 +189,4 @@ (define (guix-system-search . args) (leave-on-EPIPE (display-search-results matches (current-output-port) #:print service-type->recutils - #:regexps regexps #:command "guix system search"))))) --8<---------------cut here---------------end--------------->8--- V1 of this patch shouldn't be merged. The bug should be fixed in display-search-results's highlighting logic instead. -- Take it easy, Richard Sent Making my computer weirder one commit at a time.