GNU bug report logs - #25599
26.0.50; "Marker does not point anywhere" error signaled by primitive-undo near an overlay with an auto-removal insert-in-front-hooks value

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Wed, 1 Feb 2017 14:19:01 UTC

Severity: normal

Tags: patch

Found in version 26.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#25599: closed (Re: bug#25599: Why edit markers after insert?)
Date: Sat, 17 Jun 2017 01:07:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#25599: 26.0.50; "Marker does not point anywhere" error signaled by primitive-undo near an overlay with an auto-removal insert-in-front-hooks value

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 25599 <at> debbugs.gnu.org.

-- 
25599: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25599
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dmitry Gutov <dgutov <at> yandex.ru>
To: npostavs <at> users.sourceforge.net
Cc: 25599-done <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>,
 nitish chandra <nitishchandrachinta <at> gmail.com>
Subject: Re: bug#25599: Why edit markers after insert?
Date: Sat, 17 Jun 2017 04:06:35 +0300
On 6/11/17 9:10 PM, npostavs <at> users.sourceforge.net wrote:

> Not that I'm very familiar with the undo code, but the patch seems
> obviously correct to me.
> 
> +               ;; insert might have invalidated some of the
> +               ;; markers. We update only the currently valid
> +               ;; markers. See bug#25599
> 
> I would augment the comment to specifically mention modification hooks
> though (missing double spacing too).

Good point. Added and pushed.

Thanks all! Closing.

[Message part 3 (message/rfc822, inline)]
From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; "Marker does not point anywhere" error signaled by
 primitive-undo near an overlay with an auto-removal insert-in-front-hooks
 value
Date: Wed, 1 Feb 2017 16:18:27 +0200
In diff-hl, we create overlays to paint markers on the fringe. The
overlays are set to be deleted when text inside (or very close nearby)
is modified, for better user experience. Yet it seems to clash with 
"undo", original bug report here: 
https://github.com/dgutov/diff-hl/issues/84

Here's how to reproduce the problem without diff-hl installed:

1. Replace the contents of the scratch buffer with this:

--->
;; aaaaaaaaaaaaa
;; bbbbbbbbbbbbb

(defun overlay-modified (ov after-p _beg _end &optional length)
  (unless after-p
    (when (overlay-buffer ov)
      (delete-overlay ov))))

(save-excursion
  (goto-char (point-min))
  (let ((ov (make-overlay (line-beginning-position 2) 
(line-end-position 2))))
    (overlay-put ov 'insert-in-front-hooks '(overlay-modified))))
<---

2. Evaluate both forms at the end, the one that defines
`overlay-modified' and the one that creates the overlay.

3. Select the whole first line (;; aaa...), including the newline, so
that the region ends at the beginning of the second line.

4. Press C-w, killing the region, then M-x undo.

5. See the error "Marker does not point anywhere".

The backtrace looks like this:

Debugger entered--Lisp error: (error "Marker does not point anywhere")
  primitive-undo(1 ((#(";; aaaaaaaaaaaaa\n" 0 1 (fontified t face 
font-lock-comment-delimiter-face) 1 3 (fontified t face 
font-lock-comment-delimiter-face) 3 16 (fontified t face 
font-lock-comment-face) 16 17 (fontified t face font-lock-comment-face)) 
. 1) (#<marker at 1 in -scratch-> . -17) (#<marker in no buffer> . -17) 
(#<marker in no buffer> . -17) 18 nil undo-tree-canary))
  undo-more(1)
  undo(nil)
  funcall-interactively(undo nil)

The problem is not new, I see it in 24.5 as well.

In GNU Emacs 26.0.50.5 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2017-01-23 built on zappa
Repository revision: 03de82fe7ca09ab40fbcae394d4fcdfe3374496e
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.1 LTS



This bug report was last modified 7 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.