From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#63272: 29.0.90; xref fails on long lines Date: Fri, 05 May 2023 20:50:19 +0300 Organization: LINKOV.NET Message-ID: <86354a1xd0.fsf@mail.linkov.net> References: <86fs8cxr79.fsf@mail.linkov.net> <7393ccd9-f32f-9ce9-7159-e0fe6e1e1fef@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19542"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 63272@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 19:54:37 2023 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 1puzdc-0004sa-Pb for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 19:54:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puzd7-00043T-6e; Fri, 05 May 2023 13:54:05 -0400 Original-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 1puzd5-00042Y-9b for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:54:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puzd5-0003nE-0h for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:54:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puzd4-00087k-T6 for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 May 2023 17:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63272 X-GNU-PR-Package: emacs Original-Received: via spool by 63272-submit@debbugs.gnu.org id=B63272.168330922031175 (code B ref 63272); Fri, 05 May 2023 17:54:02 +0000 Original-Received: (at 63272) by debbugs.gnu.org; 5 May 2023 17:53:40 +0000 Original-Received: from localhost ([127.0.0.1]:57421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puzch-00086j-O2 for submit@debbugs.gnu.org; Fri, 05 May 2023 13:53:39 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:58351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puzcg-000864-Lp; Fri, 05 May 2023 13:53:39 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 12D88C0005; Fri, 5 May 2023 17:53:31 +0000 (UTC) In-Reply-To: <7393ccd9-f32f-9ce9-7159-e0fe6e1e1fef@gutov.dev> (Dmitry Gutov's message of "Thu, 4 May 2023 18:33:17 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261133 Archived-At: tags 63272 notabug close 63272 29.0.60 thanks >> 1. Create a file with a long line, e.g. type >> a C-u 500000 b c >> Save the file and commit to git. >> (long-line-optimizations-p returns t) >> 2. Try to search a regexp that matches the whole long line, e.g. >> C-x p g a.*c RET >> Debugger entered--Lisp error: (error "Stack overflow in regexp matcher") > > Isn't that more like a problem with the regexp you entered, or with our > regexp engine? > > E.g. try this: > > C-x p g a[^c]*c RET In the real case the prefix and suffix were unique, so I didn't expect that in a generated file there was a very long distance between prefix and suffix. To limit the distance between prefix and suffix I tried: C-x p g prefix.{0,100}suffix but xref that uses ripgrep fails to find matches. So needed to fall back to ripgrep-based rgrep in this case: M-x rgrep prefix.{0,100}suffix that works successfully. It seems the problem is because of different regexp syntax used by ripgrep and re-search-forward in xref--collect-matches-1. Since this is a separate problem, I'm closing this one, then a new feature request could be opened if you want.