GNU bug report logs - #50126
28.0.50; "mode: conf" and "mode: tex" get unbounded recursion

Previous Next

Package: emacs;

Reported by: Bob Rogers <rogers <at> rgrjr.com>

Date: Thu, 19 Aug 2021 17:14:02 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50126 in the body.
You can then email your comments to 50126 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50126; Package emacs. (Thu, 19 Aug 2021 17:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bob Rogers <rogers <at> rgrjr.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 19 Aug 2021 17:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bob Rogers <rogers <at> rgrjr.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; "mode: conf" and "mode: tex" get unbounded recursion
Date: Thu, 19 Aug 2021 13:11:45 -0400
   In "emacs -Q" in master rebuilt a few hours ago, when I open the file
shown below with "# -*- mode: conf; -*-" I get a "Lisp nesting exceeds
 max-lisp-eval-depth " error because conf-mode is trying to dispatch to
one of its submodes, but the submode then calls run-mode-hooks which
ends up back in conf-mode, ad inf.  Using this minimal broken.conf file:

	# -*- mode: conf; -*-

is sufficient; here's the top of the backtrace:

	Debugger entered--Lisp error: (error "Lisp nesting exceeds  max-lisp-eval-depth ")
	  apply(#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>) #f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>) nil)
	  conf-mode()
	  conf-unix-mode()
	  #f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>)(#f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>))
	  apply(#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>) #f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>) nil)
	  conf-mode()
	  hack-one-local-variable(mode conf)
	  hack-local-variables-apply()
	  hack-local-variables(no-mode)
	  run-mode-hooks(conf-unix-mode-hook)
	  conf-unix-mode()
	  #f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>)(#f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>))
	  apply(#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>) #f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>) nil)
	  conf-mode()
	  hack-one-local-variable(mode conf)
	  . . .

It fails with conf-unix-mode in the simple case of the configuration
file above; unsurprisingly, I've also seen it fail with conf-space-mode.
And "mode: tex;" has the same general problem, since it uses the same
dispatch logic.

   I would attempt a patch, but I have no clue what TRT would be here.
It would seem cleanest to keep conf-mode and tex-mode as user-visible
modes, and make new generic-conf-mode and generic-tex-mode parents for
their submodes, but that seems like it could be a fairly large change.
Using delay-mode-hooks might be simpler, but I have no idea how that
would work.

					-- Bob Rogers
					   http://www.rgrjr.com/

------------------------------------------------------------------------
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2021-08-19 built on orion
Repository revision: a44432a773f7e131692e3f5c9d765cffeef0739a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: openSUSE Leap 15.3

Configured using:
 'configure --with-dbus=no --with-gsettings=no --with-gif=ifavailable
 --with-tiff=no --with-gnutls=yes --with-gconf=no'

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LIBSELINUX LIBXML2
MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50126; Package emacs. (Fri, 20 Aug 2021 13:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 50126 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Bob Rogers <rogers <at> rgrjr.com>
Cc: 50126 <at> debbugs.gnu.org
Subject: Re: bug#50126: 28.0.50; "mode: conf" and "mode: tex" get unbounded
 recursion
Date: Fri, 20 Aug 2021 15:58:05 +0200
Bob Rogers <rogers <at> rgrjr.com> writes:

> It fails with conf-unix-mode in the simple case of the configuration
> file above; unsurprisingly, I've also seen it fail with conf-space-mode.
> And "mode: tex;" has the same general problem, since it uses the same
> dispatch logic.

Yeah, that's pretty odd dispatch logic, but I guess it's for historical
reasons.

The easy way to hack around this issue is to just disable recursion via
file-local variables, so I've done that now in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 50126 <at> debbugs.gnu.org and Bob Rogers <rogers <at> rgrjr.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 Aug 2021 13:59:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Sep 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 278 days ago.

Previous Next


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