GNU bug report logs - #31551
27.0.50; emacs hangs in hexl-mode on modula2 files

Previous Next

Package: emacs;

Reported by: Alexandre Adolphe <alexandre.adolphe <at> gmail.com>

Date: Tue, 22 May 2018 13:25:02 UTC

Severity: normal

Found in version 27.0.50

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#31551: closed (27.0.50; emacs hangs in hexl-mode on modula2
 files)
Date: Fri, 22 Jun 2018 03:33:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 21 Jun 2018 23:31:55 -0400
with message-id <jwvzhzn8plw.fsf-monnier+emacsbugs <at> gnu.org>
and subject line Re: bug#31551: 27.0.50; emacs hangs in hexl-mode on modula2 files
has caused the debbugs.gnu.org bug report #31551,
regarding 27.0.50; emacs hangs in hexl-mode on modula2 files
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
31551: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31551
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Alexandre Adolphe <alexandre.adolphe <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; emacs hangs in hexl-mode on modula2 files
Date: Tue, 22 May 2018 15:24:09 +0200
[Message part 3 (text/plain, inline)]
Hi,

I run into an issue lately while trying to use the hexl-mode with
a modula2 file that I found and emacs starts to hang after the
hexl-mode starts. I tested it on emacs 24.5, 25.2 and master.

To reproduce the issue you can use :
echo "abcd" > test.MOD
emacs -Q --eval '(show-paren-mode 1)' test.MOD
M-x hexl-mode

--> emacs hangs and use 100% cpu. It only happen on the first character so
we can run out the hang with multiple C-g + an arrow key.

I dig into the issue and it appears that the was because of the
show-paren-mode and the fact that the ":" character have meaning in
modula-2-mode. Emacs is stuck in the loop of the
m2-smie-refine-colon function because after the "00000000" that start
the hexl buffer there is no more sexp to parse so the tok variable is
empty but the (forward-sexp -1) call does not fail.

I fixed that myself by stopping the loop if the point is at the beginning
of the buffer. Not sure if it correct but here is the diff :

diff --git a/lisp/progmodes/modula2.el b/lisp/progmodes/modula2.el
index 582e495..30c8c46 100644
--- a/lisp/progmodes/modula2.el
+++ b/lisp/progmodes/modula2.el
@@ -203,6 +203,7 @@ m2-smie-refine-colon
     (while (not res)
       (let ((tok (smie-default-backward-token)))
         (cond
+         ((= (point) (point-min)) (setq res ":"))
          ((zerop (length tok))
           (let ((forward-sexp-function nil))
             (condition-case nil


I am not really into modula2 files but this bug was quite surprising.

best regards,
Alexandre
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: 31551-done <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>, alexandre.adolphe <at> gmail.com
Subject: Re: bug#31551: 27.0.50; emacs hangs in hexl-mode on modula2 files
Date: Thu, 21 Jun 2018 23:31:55 -0400
> idea.  So I plan on cleaning it up (and adding an entry in NEWS, not
> sure if it deserves an entry in the lispref) and installing it
> into master.

Installed,


        Stefan


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

Previous Next


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