From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35264: "Match data clobbered by buffer modification hooks" when hooks only shifted match-data's markers Date: Wed, 12 May 2021 17:55:58 +0300 Message-ID: <83o8dg2e81.fsf@gnu.org> References: <87h8b119oy.fsf@gmail.com> <871s0f7det.fsf@gmail.com> <87a6x5z11g.fsf@gnus.org> <8735usj9z9.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24814"; mail-complaints-to="usenet@ciao.gmane.io" Cc: npostavs@gmail.com, monnier@iro.umontreal.ca, 35264@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 12 16:56:23 2021 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 1lgqHe-0006L2-0A for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 16:56:22 +0200 Original-Received: from localhost ([::1]:37166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgqHd-0002gj-2I for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 10:56:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgqHK-0002fs-JR for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:56:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56733) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgqHK-0003Xm-At for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgqHK-0002NA-8O for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 May 2021 14:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35264 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35264-submit@debbugs.gnu.org id=B35264.16208313609113 (code B ref 35264); Wed, 12 May 2021 14:56:02 +0000 Original-Received: (at 35264) by debbugs.gnu.org; 12 May 2021 14:56:00 +0000 Original-Received: from localhost ([127.0.0.1]:40046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgqHI-0002Mu-6c for submit@debbugs.gnu.org; Wed, 12 May 2021 10:56:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgqHF-0002Mi-TP for 35264@debbugs.gnu.org; Wed, 12 May 2021 10:55:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60626) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgqHA-0003MG-31; Wed, 12 May 2021 10:55:52 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2061 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgqH9-0004OT-7U; Wed, 12 May 2021 10:55:51 -0400 In-Reply-To: <8735usj9z9.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 12 May 2021 16:35:38 +0200) 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:206335 Archived-At: > From: Lars Ingebrigtsen > Date: Wed, 12 May 2021 16:35:38 +0200 > Cc: stefan monnier , 35264@debbugs.gnu.org > > Lars Ingebrigtsen writes: > > >> But the modification hook in question did call save-match-data. As far > >> as I can tell, the problem is that the match-data consists of markers, > >> whose position gets shifted by deletion of characters. The check for > >> this error uses simple integers, so there's no way it can account for > >> this. > > > > That does make sense, but removing this (somewhat buggy) sanity check is > > perhaps a bit scary. Any comments on this? > > There were no comments, and the patch no longer applies. I've respun it > now for Emacs 28, and this fixes the case reported in this bug report > (which still reproduces in Emacs 28). > > Any comments? What about bug#23869, which triggered the addition of that code?