From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 05:12:31 2010 Received: (at submit) by debbugs.gnu.org; 16 Oct 2010 09:12:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P72oZ-0005uj-7Q for submit@debbugs.gnu.org; Sat, 16 Oct 2010 05:12:31 -0400 Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P72oW-0005ud-DD for submit@debbugs.gnu.org; Sat, 16 Oct 2010 05:12:29 -0400 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id 5882F8C670 for ; Sat, 16 Oct 2010 12:16:04 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A049925483F; Sat, 16 Oct 2010 12:16:04 +0300 Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 3FF47402E for ; Sat, 16 Oct 2010 12:16:02 +0300 (EEST) From: Jari Aalto To: submit@debbugs.gnu.org Subject: re-search-forward goes infinite loop with dash inside [] Mail-Copies-To: poster Date: Sat, 16 Oct 2010 12:16:01 +0300 Message-ID: <87sk06pkfi.fsf@picasso.cante.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Antivirus: VAMS X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.8 (-) Package: emacs Version: 23.2+1-4 Severity: normal Executing the following code causes Emacs to go into infinite loop. Simply run it behind the last paren with C-x C-e (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") ========== If the dash is taken awy from the "[a-z0-9.-]", this code does not cause infinite loop: (re-search-forward "^\\([a-z0-9.]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") TEST ROWS FOR THE REGEXPS: row-one 1234 rest of line row2 1234 rest of line TEST SETUP emacs -Q --no-site-file -- System Information Debian Release: squeeze/sid APT Prefers testing APT policy: (990, testing) (500, unstable) (1, experimental) Architecture: amd64 Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux Locale: LANG=en_DK.UTF-8 -- Versions of packages `emacs depends on'. Depends: emacs23 23.2+1-4 GNU Emacs is the extensible self-documenting emacs23-lucid 23.2+1-4 GNU Emacs is the extensible self-documenting emacs23-nox 23.2+1-4 GNU Emacs is the extensible self-documenting From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 07:24:11 2010 Received: (at 7227) by debbugs.gnu.org; 16 Oct 2010 11:24:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P74ry-0006ql-R7 for submit@debbugs.gnu.org; Sat, 16 Oct 2010 07:24:11 -0400 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P74rx-0006qe-5N for 7227@debbugs.gnu.org; Sat, 16 Oct 2010 07:24:09 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id E35F91C00500; Sat, 16 Oct 2010 13:27:37 +0200 (CEST) Received: from igel.home (ppp-93-104-129-199.dynamic.mnet-online.de [93.104.129.199]) by mail.mnet-online.de (Postfix) with ESMTP id B50C31C00207; Sat, 16 Oct 2010 13:27:37 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 4FC6DCA2A0; Sat, 16 Oct 2010 13:27:37 +0200 (CEST) From: Andreas Schwab To: Jari Aalto Subject: Re: bug#7227: re-search-forward goes infinite loop with dash inside [] References: <87sk06pkfi.fsf@picasso.cante.net> X-Yow: --Hello, POLICE? I"ve got ABBOTT & COSTELLO here on suspicion of HIGHWAY ROBBERY!! Date: Sat, 16 Oct 2010 13:27:36 +0200 In-Reply-To: <87sk06pkfi.fsf@picasso.cante.net> (Jari Aalto's message of "Sat, 16 Oct 2010 12:16:01 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 7227 Cc: 7227@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Jari Aalto writes: > Executing the following code causes Emacs to go into infinite loop. > Simply run it behind the last paren with C-x C-e > > (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") Works fine here. Note that nested repetitions like \([...]+\)+ are bad in any case. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 07:36:24 2010 Received: (at submit) by debbugs.gnu.org; 16 Oct 2010 11:36:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P753o-0007bJ-76 for submit@debbugs.gnu.org; Sat, 16 Oct 2010 07:36:24 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P753m-0007bE-1O for submit@debbugs.gnu.org; Sat, 16 Oct 2010 07:36:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P757G-000194-TE for submit@debbugs.gnu.org; Sat, 16 Oct 2010 07:39:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:60389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P757G-00018z-RA for submit@debbugs.gnu.org; Sat, 16 Oct 2010 07:39:58 -0400 Received: from [140.186.70.92] (port=36727 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P757F-0004Fk-KQ for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2010 07:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P757E-00018Y-5h for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2010 07:39:57 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:58166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P757D-00018L-RK for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2010 07:39:56 -0400 Received: from noname.home (brln-4dbc7a5b.pool.mediaWays.net [77.188.122.91]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MZfLS-1POBUa0AH8-00L3lQ; Sat, 16 Oct 2010 13:39:54 +0200 Message-ID: <4CB98EDC.6030501@easy-emacs.de> Date: Sat, 16 Oct 2010 13:39:08 +0200 From: =?ISO-8859-1?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: Re: bug#7227: re-search-forward goes infinite loop with dash inside [] References: <87sk06pkfi.fsf@picasso.cante.net> In-Reply-To: <87sk06pkfi.fsf@picasso.cante.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:TbZfjQO5Rg8OTabw1C6LuzN6/CRNqFUlyMo3xKym63q 7wdiUhxNewFncD3JdgO2Qi5BH/cSlq6GsLl2jA5ScIZWQVvjhz gBywV0Zkkx8j9KIIUP0+HMfgrwxjpRQEq3JQF/Nuv36no+WuIr 6+y9v63XeieVarNl+/1861MUUavbrcyuTsKhpUjbYk7jmX5q+o KJYZhdBBLgLmO7fgsiI2czz7e9in5Cs8bVoYyIhxgo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.2 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) Am 16.10.2010 11:16, schrieb Jari Aalto: > Package: emacs Version: 23.2+1-4 Severity: normal > > Executing the following code causes Emacs to go into infinite loop. > Simply run it behind the last paren with C-x C-e > > (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) > +\\([a-z].*\\)") ========== > > If the dash is taken awy from the "[a-z0-9.-]", this code does not > cause infinite loop: > > (re-search-forward "^\\([a-z0-9.]+\\)+[ \t]+\\([0-9]+\\) > +\\([a-z].*\\)") > > TEST ROWS FOR THE REGEXPS: > > row-one 1234 rest of line > > row2 1234 rest of line > > TEST SETUP > > emacs -Q --no-site-file into buffer> statements> > > -- System Information Debian Release: squeeze/sid APT Prefers > testing APT policy: (990, testing) (500, unstable) (1, experimental) > Architecture: amd64 Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Fri > Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux Locale: LANG=en_DK.UTF-8 > > -- Versions of packages `emacs depends on'. Depends: emacs23 > 23.2+1-4 GNU Emacs is the extensible self-documenting > emacs23-lucid 23.2+1-4 GNU Emacs is the extensible > self-documenting emacs23-nox 23.2+1-4 GNU Emacs is the > extensible self-documenting > > > > Hi, can't reproduce this with GNU Emacs 23.1.1 (i586-suse-linux-gnu, GTK+ Version 2.20.1) of 2010-07-05 in scratch buffer I get an error immediatly: Debugger entered--Lisp error: (search-failed "^\\([a-z0-9.-]+\\)+[ ]+\\([0-9]+\\) +\\([a-z].*\\)") re-search-forward("^\\([a-z0-9.-]+\\)+[ ]+\\([0-9]+\\) +\\([a-z].*\\)") eval((re-search-forward "^\\([a-z0-9.-]+\\)+[ ]+\\([0-9]+\\) +\\([a-z].*\\)")) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) Thanks for tiny-tools BTW. Andreas -- https://code.launchpad.net/~a-roehler/python-mode/python-mode-components https://code.launchpad.net/s-x-emacs-werkstatt/ From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 09:38:30 2010 Received: (at 7227) by debbugs.gnu.org; 16 Oct 2010 13:38:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P76xx-0008Sz-BN for submit@debbugs.gnu.org; Sat, 16 Oct 2010 09:38:29 -0400 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P76xv-0008Sr-79 for 7227@debbugs.gnu.org; Sat, 16 Oct 2010 09:38:28 -0400 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id ECE2118D01B; Sat, 16 Oct 2010 16:42:03 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A070CEEA3F9; Sat, 16 Oct 2010 16:42:03 +0300 Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id CFF6C4030; Sat, 16 Oct 2010 16:42:00 +0300 (EEST) From: Jari Aalto To: 7227@debbugs.gnu.org Subject: Re: bug#7227: re-search-forward goes infinite loop with dash inside [] Organization: Private References: <1213200935.4147.62.camel@cyberelk.elk> References: Date: Sat, 16 Oct 2010 16:42:00 +0300 In-Reply-To: <1213200935.4147.62.camel@cyberelk.elk> (Tim Waugh's message of "Wed, 11 Jun 2008 17:15:35 +0100") Message-ID: <87eibqp847.fsf_-_@picasso.cante.net> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Antivirus: VAMS X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 7227 Cc: Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) Andreas Schwab writes: > Jari Aalto writes: > >> Executing the following code causes Emacs to go into infinite loop. >> Simply run it behind the last paren with C-x C-e >> >> (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") > > Works fine here. Hm. The test case needs adjustment: ;; (1) Run C-x C-e, works: (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") row2 1234 rest of line ;; (2) but C-x C-e below causes a loop (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") ------------------------------------------------------------------------ row2 1234 rest of line > Note that nested repetitions like \([...]+\)+ are bad in any case. This was only a test. The anchor "^" should help, and I assume the first '[a-z0-9.-]+' should be greedy, so it shouldn't take that long to resolve. Jari From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 09:50:43 2010 Received: (at 7227) by debbugs.gnu.org; 16 Oct 2010 13:50:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P779m-00006c-Rf for submit@debbugs.gnu.org; Sat, 16 Oct 2010 09:50:43 -0400 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P779k-00006V-9R for 7227@debbugs.gnu.org; Sat, 16 Oct 2010 09:50:41 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 8B52C1C00108; Sat, 16 Oct 2010 15:54:17 +0200 (CEST) Received: from igel.home (ppp-93-104-129-199.dynamic.mnet-online.de [93.104.129.199]) by mail.mnet-online.de (Postfix) with ESMTP id 6F71A1C002F1; Sat, 16 Oct 2010 15:54:17 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 3F10ACA2A0; Sat, 16 Oct 2010 15:54:17 +0200 (CEST) From: Andreas Schwab To: Jari Aalto Subject: Re: bug#7227: re-search-forward goes infinite loop with dash inside [] References: <1213200935.4147.62.camel@cyberelk.elk> <87eibqp847.fsf_-_@picasso.cante.net> X-Yow: I think I'll make SCRAMBLED EGGS!! They're each in LITTLE SHELLS.. Date: Sat, 16 Oct 2010 15:54:17 +0200 In-Reply-To: <87eibqp847.fsf_-_@picasso.cante.net> (Jari Aalto's message of "Sat, 16 Oct 2010 16:42:00 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 7227 Cc: 7227@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Jari Aalto writes: > Hm. The test case needs adjustment: > > ;; (1) Run C-x C-e, works: > > (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") > row2 1234 rest of line > > ;; (2) but C-x C-e below causes a loop > > (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") > ------------------------------------------------------------------------ > row2 1234 rest of line > >> Note that nested repetitions like \([...]+\)+ are bad in any case. > > This was only a test. The anchor "^" should help, and I assume the first > '[a-z0-9.-]+' should be greedy, so it shouldn't take that long to > resolve. Not in the non-matching case. When the match against the dash line is tried you get quadratic behaviour due to explosion of the search tree. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 22 03:51:56 2010 Received: (at 7227-done) by debbugs.gnu.org; 22 Oct 2010 07:51:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P9CPs-00089A-7J for submit@debbugs.gnu.org; Fri, 22 Oct 2010 03:51:56 -0400 Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P9CPp-000895-8y for 7227-done@debbugs.gnu.org; Fri, 22 Oct 2010 03:51:54 -0400 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id 1CD5E13C3DF for <7227-done@debbugs.gnu.org>; Fri, 22 Oct 2010 10:55:45 +0300 (EEST) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A035D31AB0F; Fri, 22 Oct 2010 10:55:45 +0300 Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 005B041BE2 for <7227-done@debbugs.gnu.org>; Fri, 22 Oct 2010 10:55:43 +0300 (EEST) From: Jari Aalto To: 7227-done@debbugs.gnu.org Subject: Bug#7227 Close bts:gnu Mail-Copies-To: poster X-Bug-User-Agent: Emacs 23.2.1 and tinydebian.el 2010.0616.1707 Date: Fri, 22 Oct 2010 10:55:43 +0300 Message-ID: <8762wu1x1c.fsf@picasso.cante.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Antivirus: VAMS X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 7227-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) Reason for close: Not a bug. In non-matching case, the regexp engine pumps up; thus "Loop effect" feel. From unknown Mon Aug 18 14:23:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 19 Nov 2010 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator