From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#53680: Endless loop in peculiar case of string-match and string-match-p 27.02 and 28.0.50 Date: Tue, 01 Feb 2022 13:16:30 +0100 Message-ID: <87sft2vl29.fsf@gnus.org> References: <183c66f4-463a-b372-feee-5af9f6f45719@cvj.se> <8735l2x35t.fsf@gnus.org> <87pmo63kio.fsf@igel.home> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4644"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Christian Johansson , 53680@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 01 13:21:04 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nEs9f-00011A-Dq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Feb 2022 13:21:03 +0100 Original-Received: from localhost ([::1]:38696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEs9d-0003ig-Kt for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Feb 2022 07:21:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEs5u-0008On-Ez for bug-gnu-emacs@gnu.org; Tue, 01 Feb 2022 07:17:10 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEs5m-0006KI-Db for bug-gnu-emacs@gnu.org; Tue, 01 Feb 2022 07:17:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nEs5m-0006n0-9c for bug-gnu-emacs@gnu.org; Tue, 01 Feb 2022 07:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Feb 2022 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 53680-submit@debbugs.gnu.org id=B53680.164371780326050 (code B ref 53680); Tue, 01 Feb 2022 12:17:02 +0000 Original-Received: (at 53680) by debbugs.gnu.org; 1 Feb 2022 12:16:43 +0000 Original-Received: from localhost ([127.0.0.1]:41978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEs5S-0006m5-TY for submit@debbugs.gnu.org; Tue, 01 Feb 2022 07:16:43 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:56732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEs5Q-0006lh-Su for 53680@debbugs.gnu.org; Tue, 01 Feb 2022 07:16:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References: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=fXNz8JKLPTaj29JdWxj6TXamnh+Zi/LCwRFQ0MHE3x0=; b=RwrpR4ynGTe43apOY8gTtK4s8p gBEzbOoCeAtP2U2yao4KgqMuoUT6Hb6hb5Q01bQpbIODW+VUOpqjw5IlcF4NRIV090ve+3cROv/CS fB9++6JXVdvpLiJVHTmxBkJzGpCDezC8aPV/06TaVy3Ssut3RDtPtEUZylHk+voVIlmQ=; Original-Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nEs5H-0006rR-JA; Tue, 01 Feb 2022 13:16:34 +0100 X-Now-Playing: Ron Rogers's _Don't Play With My Emotions_: "Somewhere In Space" In-Reply-To: <87pmo63kio.fsf@igel.home> (Andreas Schwab's message of "Tue, 01 Feb 2022 12:15:43 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:225747 Archived-At: Andreas Schwab writes: > It sure is. The nesting of the + operator without proper anchoring > makes the search space explode. Yup. So something like (string-match "[\r\t ]*implements\\([\r\t ]+[\\a-zA-Z_0-9_]+,?\\)+[\r\t ]*{$" "ariable implements \\Magento\\Framework\\Event\\OberserverInterface\r{\r public function __construct()\r ") won't have the same explosion (and indeed finished immediately). So I don't think this is an Emacs bug, just a very tough regexp to match. There's been some talk about replacing Emacs' regexp motor with something that has better backtracking characteristics, but I don't recall if anybody has actually made any moves to make that happen. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no