From unknown Mon Aug 18 19:27:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12077: Abort in replace-regexp with an after-change-functions hook Resent-From: Rob Browning Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Jul 2012 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12077 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12077@debbugs.gnu.org Cc: 682995-forwarded@bugs.debian.org, Christopher Wellons , 682995@bugs.debian.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13434984443140 (code B ref -1); Sat, 28 Jul 2012 18:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Jul 2012 18:00:44 +0000 Received: from localhost ([127.0.0.1]:46990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SvBJk-0000ob-BI for submit@debbugs.gnu.org; Sat, 28 Jul 2012 14:00:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58814) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SvBJi-0000oU-JL for submit@debbugs.gnu.org; Sat, 28 Jul 2012 14:00:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvBCr-0000qq-VQ for submit@debbugs.gnu.org; Sat, 28 Jul 2012 13:53:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvBCr-0000qm-SY for submit@debbugs.gnu.org; Sat, 28 Jul 2012 13:53:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvBCq-0006qU-Sm for bug-gnu-emacs@gnu.org; Sat, 28 Jul 2012 13:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvBCp-0000qQ-K1 for bug-gnu-emacs@gnu.org; Sat, 28 Jul 2012 13:53:36 -0400 Received: from defaultvalue.org ([70.85.129.156]:58782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvBCp-0000q7-Fb for bug-gnu-emacs@gnu.org; Sat, 28 Jul 2012 13:53:35 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 4AAC090D35; Sat, 28 Jul 2012 12:56:22 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 22C5314E0C5; Sat, 28 Jul 2012 12:53:33 -0500 (CDT) From: Rob Browning References: <20120727200247.7276.54835.reportbug@susie.zeus.nullprogram.com> Date: Sat, 28 Jul 2012 12:53:33 -0500 In-Reply-To: <20120727200247.7276.54835.reportbug@susie.zeus.nullprogram.com> (Christopher Wellons's message of "Fri, 27 Jul 2012 16:02:47 -0400") Message-ID: <87wr1n22n6.fsf@trouble.defaultvalue.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -6.9 (------) (If possible, please preserve the 682995-forwarded address in any replies.) The following bug report was recently filed, and I've tried the example, and saw the same abort. You can find additional information here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682995 Christopher Wellons writes: > Package: emacs24 > Version: 24.1+1-4 > Severity: normal > > When this expression is evaluated, Emacs will abort. > > (with-temp-buffer > (insert "#\n*\n") > (goto-char (point-min)) > (add-hook 'after-change-functions > (lambda (a b c) (re-search-forward "\n" nil t))) > (replace-regexp "^\\*" " *")) > > It is also provided in an attached file, example.el, in order to make > this easier to demonstrate. > > emacs -q -l example.el > > The abort() occurs in the check at the beginning of > buf_charpos_to_bytepos() in marker.c, because the point has left the > buffer bounds. I ran into this bug while trying to perform this > replace-regexp while in a third-party markdown-mode, and narrowed it > down to this combination of events. > > This bug also appears in emacs23 in both squeeze and sid as well as > upstream and non-Debian builds of Emacs. Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 From unknown Mon Aug 18 19:27:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Rob Browning Subject: bug#12077: closed (Re: bug#12077: Abort in replace-regexp with an after-change-functions hook) Message-ID: References: <0cbobgut7x.fsf@fencepost.gnu.org> <87wr1n22n6.fsf@trouble.defaultvalue.org> X-Gnu-PR-Message: they-closed 12077 X-Gnu-PR-Package: emacs Reply-To: 12077@debbugs.gnu.org Date: Tue, 19 Feb 2013 17:10:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1361293801-31003-1" This is a multi-part message in MIME format... ------------=_1361293801-31003-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #12077: Abort in replace-regexp with an after-change-functions hook which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 12077@debbugs.gnu.org. --=20 12077: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12077 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1361293801-31003-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12077-done) by debbugs.gnu.org; 19 Feb 2013 17:09:45 +0000 Received: from localhost ([127.0.0.1]:37169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7qhN-00083U-0E for submit@debbugs.gnu.org; Tue, 19 Feb 2013 12:09:45 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:52205) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7qhL-00083O-B8 for 12077-done@debbugs.gnu.org; Tue, 19 Feb 2013 12:09:44 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1U7qgF-00048T-EF; Tue, 19 Feb 2013 12:08:35 -0500 From: Glenn Morris To: 12077-done@debbugs.gnu.org, Subject: Re: bug#12077: Abort in replace-regexp with an after-change-functions hook References: <20120727200247.7276.54835.reportbug@susie.zeus.nullprogram.com> <87wr1n22n6.fsf@trouble.defaultvalue.org> X-Spook: csystems rail gun InfoSec codes Ortega ASDIC Blowfish X-Ran: Cnt:fM4`W?RfKdnaB,|FNY~l\@ (Rob Browning's message of "Sat, 28 Jul 2012 12:53:33 -0500") Message-ID: <0cbobgut7x.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: 12077-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -7.5 (-------) Version: 24.4 Rob Browning wrote: >> When this expression is evaluated, Emacs will abort. >> >> (with-temp-buffer >> (insert "#\n*\n") >> (goto-char (point-min)) >> (add-hook 'after-change-functions >> (lambda (a b c) (re-search-forward "\n" nil t))) >> (replace-regexp "^\\*" " *")) By experiment, this issue is present in at least 22.3 through 24.2.93, but is fixed in the current trunk. ------------=_1361293801-31003-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Jul 2012 18:00:44 +0000 Received: from localhost ([127.0.0.1]:46990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SvBJk-0000ob-BI for submit@debbugs.gnu.org; Sat, 28 Jul 2012 14:00:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58814) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SvBJi-0000oU-JL for submit@debbugs.gnu.org; Sat, 28 Jul 2012 14:00:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvBCr-0000qq-VQ for submit@debbugs.gnu.org; Sat, 28 Jul 2012 13:53:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvBCr-0000qm-SY for submit@debbugs.gnu.org; Sat, 28 Jul 2012 13:53:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvBCq-0006qU-Sm for bug-gnu-emacs@gnu.org; Sat, 28 Jul 2012 13:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvBCp-0000qQ-K1 for bug-gnu-emacs@gnu.org; Sat, 28 Jul 2012 13:53:36 -0400 Received: from defaultvalue.org ([70.85.129.156]:58782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvBCp-0000q7-Fb for bug-gnu-emacs@gnu.org; Sat, 28 Jul 2012 13:53:35 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 4AAC090D35; Sat, 28 Jul 2012 12:56:22 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 22C5314E0C5; Sat, 28 Jul 2012 12:53:33 -0500 (CDT) From: Rob Browning To: bug-gnu-emacs@gnu.org Subject: Abort in replace-regexp with an after-change-functions hook References: <20120727200247.7276.54835.reportbug@susie.zeus.nullprogram.com> Date: Sat, 28 Jul 2012 12:53:33 -0500 In-Reply-To: <20120727200247.7276.54835.reportbug@susie.zeus.nullprogram.com> (Christopher Wellons's message of "Fri, 27 Jul 2012 16:02:47 -0400") Message-ID: <87wr1n22n6.fsf@trouble.defaultvalue.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit Cc: 682995-forwarded@bugs.debian.org, Christopher Wellons , 682995@bugs.debian.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -6.9 (------) (If possible, please preserve the 682995-forwarded address in any replies.) The following bug report was recently filed, and I've tried the example, and saw the same abort. You can find additional information here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682995 Christopher Wellons writes: > Package: emacs24 > Version: 24.1+1-4 > Severity: normal > > When this expression is evaluated, Emacs will abort. > > (with-temp-buffer > (insert "#\n*\n") > (goto-char (point-min)) > (add-hook 'after-change-functions > (lambda (a b c) (re-search-forward "\n" nil t))) > (replace-regexp "^\\*" " *")) > > It is also provided in an attached file, example.el, in order to make > this easier to demonstrate. > > emacs -q -l example.el > > The abort() occurs in the check at the beginning of > buf_charpos_to_bytepos() in marker.c, because the point has left the > buffer bounds. I ran into this bug while trying to perform this > replace-regexp while in a third-party markdown-mode, and narrowed it > down to this combination of events. > > This bug also appears in emacs23 in both squeeze and sid as well as > upstream and non-Debian builds of Emacs. Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 ------------=_1361293801-31003-1-- From unknown Mon Aug 18 19:27:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12077: Abort in replace-regexp with an after-change-functions hook Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Feb 2013 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12077 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12077@debbugs.gnu.org Received: via spool by 12077-submit@debbugs.gnu.org id=B12077.13612971614162 (code B ref 12077); Tue, 19 Feb 2013 18:06:02 +0000 Received: (at 12077) by debbugs.gnu.org; 19 Feb 2013 18:06:01 +0000 Received: from localhost ([127.0.0.1]:37288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7rZo-000154-2n for submit@debbugs.gnu.org; Tue, 19 Feb 2013 13:06:00 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:55781) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7rZl-00014x-Ml for 12077@debbugs.gnu.org; Tue, 19 Feb 2013 13:05:58 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1U7rYg-0000QV-Et; Tue, 19 Feb 2013 13:04:50 -0500 From: Glenn Morris References: <20120727200247.7276.54835.reportbug@susie.zeus.nullprogram.com> <87wr1n22n6.fsf@trouble.defaultvalue.org> <0cbobgut7x.fsf@fencepost.gnu.org> X-Spook: fraud enemy of the state monarchist Becker SCUD missile X-Ran: /'?0o>YUrw1tJ."*304l\3NS9(t<,!W>; (Glenn Morris's message of "Tue, 19 Feb 2013 12:08:34 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.6 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -7.5 (-------) Glenn Morris wrote: >>> (with-temp-buffer >>> (insert "#\n*\n") >>> (goto-char (point-min)) >>> (add-hook 'after-change-functions >>> (lambda (a b c) (re-search-forward "\n" nil t))) >>> (replace-regexp "^\\*" " *")) > > By experiment, this issue is present in at least 22.3 through 24.2.93, > but is fixed in the current trunk. PS if someone feels like checking exactly what fixed this, then if it is a simple and obviously safe change, it could go in emacs-24. But since this is a long-standing issue, this is not essential.