From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alexandre Adolphe Newsgroups: gmane.emacs.bugs Subject: bug#31551: 27.0.50; emacs hangs in hexl-mode on modula2 files Date: Tue, 22 May 2018 15:24:09 +0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000651ee1056ccb55e1" X-Trace: blaine.gmane.org 1526995391 23237 195.159.176.226 (22 May 2018 13:23:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 May 2018 13:23:11 +0000 (UTC) To: 31551@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 22 15:23:07 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fL7Fr-0005xv-3v for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 May 2018 15:23:07 +0200 Original-Received: from localhost ([::1]:55776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fL7Hx-0000VV-PW for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 May 2018 09:25:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fL7Hj-0000SV-O8 for bug-gnu-emacs@gnu.org; Tue, 22 May 2018 09:25:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fL7Hi-0000mC-I6 for bug-gnu-emacs@gnu.org; Tue, 22 May 2018 09:25:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35905) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fL7Hi-0000le-FH for bug-gnu-emacs@gnu.org; Tue, 22 May 2018 09:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fL7Hi-0002IF-8w for bug-gnu-emacs@gnu.org; Tue, 22 May 2018 09:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alexandre Adolphe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 May 2018 13:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31551 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15269954648757 (code B ref -1); Tue, 22 May 2018 13:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 May 2018 13:24:24 +0000 Original-Received: from localhost ([127.0.0.1]:43801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fL7H6-0002HB-3h for submit@debbugs.gnu.org; Tue, 22 May 2018 09:24:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fL7H4-0002Gz-4F for submit@debbugs.gnu.org; Tue, 22 May 2018 09:24:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fL7Gx-0008Q0-TI for submit@debbugs.gnu.org; Tue, 22 May 2018 09:24:16 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fL7Gx-0008Ps-PV for submit@debbugs.gnu.org; Tue, 22 May 2018 09:24:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fL7Gw-0000FX-HO for bug-gnu-emacs@gnu.org; Tue, 22 May 2018 09:24:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fL7Gu-0008Nt-5E for bug-gnu-emacs@gnu.org; Tue, 22 May 2018 09:24:14 -0400 Original-Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:37127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fL7Gt-0008Nl-Rt for bug-gnu-emacs@gnu.org; Tue, 22 May 2018 09:24:12 -0400 Original-Received: by mail-wm0-x22b.google.com with SMTP id l1-v6so33652496wmb.2 for ; Tue, 22 May 2018 06:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=dC/ieOeR2PM36wEB6u/ACy21JCk1lwGA34rpwGbW0E8=; b=OAi2YHWgv2AcfMby4mitM9EHkfsgaVYvbj+eiASLO8QVMSSVl7LacncLjJHuYEw7SG qsvlUFlJFzNU6LeMfTK7yHZaaG8f3klGrUm8weqZGkT6+DjmJ30N00cR5Aagzd51uWVl FYyX9cex7iSNdSX3xIB1or2wBboV8ME2fRHZrvinNsIt4n8kEk/mieSb4KCfk7g41QTr PuA5iE2zNvGcrLuu6ChTTvmC0+fta1EMnq0EA8RnxILE9E6DupVnEq/24MXtrFAo3SZZ DZnX/VoL4eIYJJv6IV9StQWSRFlPbLHMr4U3H/JAjUdnJNBTWy3Tp+qwhQySbXK9HaCq yAWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=dC/ieOeR2PM36wEB6u/ACy21JCk1lwGA34rpwGbW0E8=; b=NEdTbhY/5QwBdJKeaogKmKSBJgMhZcZLRc5ytr69YLhPrM2Wr9wZIf5Vj5EssmZt7i ohq/UukmIrGnFFAWvyTXkagVfYf0Xj/etzOp+W/wQuhoLit90G2MSUoYAjI6n4y+khPb VkKTmd9RdJ4gzIubnf1wnQI9cTNkVUvEU/fWt/NN3Q4xAMRCBqf0nLqERoLU+fmq7Nq8 fDiejqvrFv5F3+7yQK22JIm7jPYXZWsV+8bRpsYQy9W3gm0xk3JMuh8LAxbqWWuWZJ6q /y+WXqcNjnWUkBQsy24FIXJ+kSTJrFxE/v9c5rGEAbmERe+DSfilSYGYWun1rZdT/8zc jR4g== X-Gm-Message-State: ALKqPwdB6F7N4FZOGuXhCae4/WViQlJJfOchCKSlpXeCF/rBV2Sb+pcn qzZKJBAKV6swg7Mj8yya294rFpVVGruDkMoSznrUeg== X-Google-Smtp-Source: AB8JxZraDjkiUbilSzXUpR2iHa1xwQN+ICwx2XamRFtdTTFvL51h/VwcvCdPBZE6fHDYkp8wSl36+DM3lP3/KRIT79A= X-Received: by 2002:a2e:997:: with SMTP id 145-v6mr15506859ljj.46.1526995450403; Tue, 22 May 2018 06:24:10 -0700 (PDT) Original-Received: by 2002:a19:2501:0:0:0:0:0 with HTTP; Tue, 22 May 2018 06:24:09 -0700 (PDT) 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.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146382 Archived-At: --000000000000651ee1056ccb55e1 Content-Type: text/plain; charset="UTF-8" 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 --000000000000651ee1056ccb55e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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.<= br>
To reproduce the issue you can use :
echo "abcd" > t= est.MOD
emacs -Q --eval '(show-paren-mode 1)' test.MOD
M-x he= xl-mode

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

I dig into the issue and it appears that the was because of the<= br>show-paren-mode and the fact that the ":" character have meani= ng in
modula-2-mode. Emacs is stuck in the loop of the
m2-smie-refin= e-colon function because after the "00000000" that start
the h= exl buffer there is no more sexp to parse so the tok variable is
empty b= ut 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 su= re 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
@@ -2= 03,6 +203,7 @@ m2-smie-refine-colon
=C2=A0=C2=A0=C2=A0=C2=A0 (while (not= res)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((tok (smie-default-back= ward-token)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cond
= +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((=3D (point) (point-min)= ) (setq res ":"))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ((zerop (length tok))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (let ((forward-sexp-function nil))
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (conditi= on-case nil


I am not really into mo= dula2 files but this bug was quite surprising.

bes= t regards,
Alexandre
--000000000000651ee1056ccb55e1--