GNU bug report logs - #15778
24.3; cperl-mode causes emacs to lock up

Previous Next

Package: emacs;

Reported by: Nathan Trapuzzano <nbtrap <at> nbtrap.com>

Date: Fri, 1 Nov 2013 11:21:02 UTC

Severity: normal

Found in version 24.3

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
Cc: 15778 <at> debbugs.gnu.org
Subject: bug#15778: 24.3; cperl-mode causes emacs to lock up
Date: Fri, 01 Nov 2013 18:26:14 +0200
> From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
> Cc: 15778 <at> debbugs.gnu.org
> Date: Fri, 01 Nov 2013 10:59:12 -0400
> 
> emacs -Q
> M-: (defalias 'perl-mode 'cperl-mode)
> C-x C-f Beta.pm
> M-x goto-line 44
> C-k

It loops here:

    (while (and beg
		(progn
		  (beginning-of-line)
		  (eq (get-text-property (setq beg (point)) 'syntax-type)
		      'multiline)))
      (if (setq beg (cperl-beginning-of-property beg 'syntax-type))
	  (goto-char beg)))

This happens because cperl-beginning-of-property does this:

  (or (previous-single-property-change (cperl-1+ p) prop lim)
      (point-min))

So it starts its search backwards for the beginning of the property
from the position 1 _after_ BEG.  In this case,
previous-single-property-change returns BEG, so the code stays at BEG,
and thus loops indefinitely.

Looks like a bug in cperl-mode, as I don't see any protection in this
loop against such a calamity.  Is it safe to assume that a
'syntax-type' property will never cover exactly one buffer position?

(I have no idea why the defalias is needed to trigger the bug.)





This bug report was last modified 11 years and 202 days ago.

Previous Next


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