From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36328: 26.2; Args out of range on search-and-replace of *.cc file Date: Mon, 24 Jun 2019 00:19:22 +0300 Organization: LINKOV.NET Message-ID: <87k1dc2e5h.fsf@mail.linkov.net> References: <20190622132549.84518.qmail@mail.muc.de> <20190622205033.GA9167@ACM> <20190623122207.GA4736@ACM> <20190623193258.GB4736@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="255289"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Jayden Navarro , 36328@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 23 23:42:38 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfAFx-0014DT-QL for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2019 23:42:38 +0200 Original-Received: from localhost ([::1]:46844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfAFw-0006Wh-La for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2019 17:42:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34991) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfAFQ-00069h-41 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 17:42:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfAFO-0006y7-U2 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 17:42:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41555) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfAFO-0006xu-Pc for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 17:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfAFO-00011M-M1 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 17:42: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: Sun, 23 Jun 2019 21:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36328 X-GNU-PR-Package: emacs Original-Received: via spool by 36328-submit@debbugs.gnu.org id=B36328.15613260903823 (code B ref 36328); Sun, 23 Jun 2019 21:42:02 +0000 Original-Received: (at 36328) by debbugs.gnu.org; 23 Jun 2019 21:41:30 +0000 Original-Received: from localhost ([127.0.0.1]:55088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfAEr-0000za-R9 for submit@debbugs.gnu.org; Sun, 23 Jun 2019 17:41:30 -0400 Original-Received: from bonobo.birch.relay.mailchannels.net ([23.83.209.22]:10144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfAEp-0000zM-Ju for 36328@debbugs.gnu.org; Sun, 23 Jun 2019 17:41:28 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 17922141818; Sun, 23 Jun 2019 21:41:26 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a96.g.dreamhost.com (100-96-85-75.trex.outbound.svc.cluster.local [100.96.85.75]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4F6891414BD; Sun, 23 Jun 2019 21:41:25 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a96.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Sun, 23 Jun 2019 21:41:26 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Zesty-Broad: 37a7f30970641059_1561326085917_1252289177 X-MC-Loop-Signature: 1561326085917:1274837065 X-MC-Ingress-Time: 1561326085917 Original-Received: from pdx1-sub0-mail-a96.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a96.g.dreamhost.com (Postfix) with ESMTP id 0A17B80C87; Sun, 23 Jun 2019 14:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=+uXwmAz7pvBNXVxkwHBMLgs7I2M=; b= l0bTAeagMI2uYDoll6nwgbKXdHSOkSbqMN//IKFl22JcX19ckRcNonGkphlarQRN ceLIyo05jxieX5+60RBso62PHOu7mAIj8pjBeZ94Hi5lTAm/wYZwydycNq81H+nZ 9tNFh0Cpzrev7hPskAy6pQiUIPi+yncRJ/C1xBuQetM= Original-Received: from mail.jurta.org (m91-129-109-209.cust.tele2.ee [91.129.109.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a96.g.dreamhost.com (Postfix) with ESMTPSA id B1F9D80C95; Sun, 23 Jun 2019 14:41:15 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a96 In-Reply-To: <20190623193258.GB4736@ACM> (Alan Mackenzie's message of "Sun, 23 Jun 2019 19:32:58 +0000") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddruddugddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuffhomhgrihhnpehgihhthhhusghushgvrhgtohhnthgvnhhtrdgtohhmnecukfhppeeluddruddvledruddtledrvddtleenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrddvtdelpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprggtmhesmhhutgdruggvnecuvehluhhsthgvrhfuihiivgeptd X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161177 Archived-At: >> Until this is officially fixed I've come up with the following workaround, >> going off of the details you provided: > >> I created a "replace_fixed.el" file in "~/.emacs.d/lisp/" that is >> replace.el taken from >> https://raw.githubusercontent.com/emacs-mirror/emacs/emacs-26/lisp/replace.el >> with >> the following diff: > >> diff --git a/replace.el b/replace_fixed.el >> index 08feb8e..8280fdd 100644 >> --- a/replace.el >> +++ b/replace_fixed.el >> @@ -2227,7 +2227,7 @@ It is called with three arguments, as if it were >> (isearch-forward (not backward)) >> (isearch-other-end match-beg) >> (isearch-error nil)) >> - (isearch-lazy-highlight-new-loop range-beg range-end)))) >> + (save-match-data (isearch-lazy-highlight-new-loop range-beg >> range-end))))) > >> (defun replace-dehighlight () >> (when replace-overlay > >> Then I added the following to my "~/.emacs", restarted my emacs server, and >> the issue was gone!: > >> (load-library "~/.emacs.d/lisp/replace_fixed.el") > >> This probably isn't the proper fix, but just thought I'd share in case >> anyone else is experiencing this and wanted a temporary workaround. > > Excellent! To be honest, I was thinking of sending just that workaround > to you as a temporary patch, but it seems I didn't need to. :-) > > That might well be the fix we end up putting into Emacs, but it might > not be. Sorry we're so slow, here. I think first we should try to narrow down the source of this match data leak. Then we could decide what is the best solution. Currently I see no such place in isearch-lazy-highlight-new-loop that calls external code. OTOH, while looking at CC-Mode I noticed that it does some matches on before-change hooks. I could debug it but can't reproduce neither in 26.1 nor in 27, even with -Q -nw.