unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: aaronjensen@gmail.com, Eshel Yaron <me@eshelyaron.com>
Cc: 63988@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#63988: 30.0.50; Recent header line format changes cause spin/seg fault with format-mode-line
Date: Sat, 10 Jun 2023 11:56:28 +0300	[thread overview]
Message-ID: <83wn0bzoeb.fsf@gnu.org> (raw)
In-Reply-To: <831qij24qm.fsf@gnu.org> (message from Eli Zaretskii on Sat, 10 Jun 2023 09:47:29 +0300)

> Cc: 63988@debbugs.gnu.org
> Date: Sat, 10 Jun 2023 09:47:29 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Aaron Jensen <aaronjensen@gmail.com>
> > Date: Fri, 09 Jun 2023 21:09:45 -0400
> > 
> > 
> > (setq header-line-format '(:eval (format-mode-line "")))
> > 
> > This causes Emacs to spin as of commit:
> > 4f66cbbfe520ee31ef26676e09a926217d9736fe
> > 
> > After some time, it will segfault.
> 
> It causes infinite recursion, since format-mode-line also calls
> window_wants_header_line (indirectly).
> 
> But what is the purpose of such a strange (to use a civilized word)
> setting of header-line-format?  Why do you need :eval at all in this
> case?
> 
> IOW, why not say "don't do that" and be done?

For now, I installed a semi-kludgey fix.

However, I wonder whether we should rethink this minor feature.
Perhaps this minor convenience is not worth the complications?
window_wants_header_line is called in many places, all of which can
now evaluate arbitrary Lisp, and all of which can now GC.  I've
audited the various callers, and didn't see anything obvious that
could cause problems with calling Lisp or GC in those places, but I
could have missed something.

This is actually a general issue with Emacs: we keep piling one minor
feature upon another, and don't always reflect on the hard-to-maintain
monster that creates.  We have already a couple of areas in the code
base where we are afraid of making changes, because we don't have a
good understanding of the complicated state variables there.  Maybe we
should reject such minor features instead of keeping doing what we
have been doing?

So maybe we should declare this feature a failed experiment and remove
it?





  reply	other threads:[~2023-06-10  8:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10  1:09 bug#63988: 30.0.50; Recent header line format changes cause spin/seg fault with format-mode-line Aaron Jensen
2023-06-10  6:47 ` Eli Zaretskii
2023-06-10  8:56   ` Eli Zaretskii [this message]
2023-06-10  9:07     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-15  5:59       ` Eli Zaretskii
2023-06-16  2:30         ` Aaron Jensen
2023-06-23 10:53         ` Eli Zaretskii
2023-07-05 15:30         ` Spencer Baugh
2023-07-05 15:40           ` Eli Zaretskii
2023-06-10 16:16     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-10 17:42       ` Eli Zaretskii
2023-06-10 17:51         ` Aaron Jensen
2023-06-10 19:11         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-10 11:08   ` Aaron Jensen
2023-06-10 11:22     ` Eli Zaretskii
2023-06-10 11:59       ` Aaron Jensen
2023-06-10 13:04         ` Eli Zaretskii
2023-06-10 15:06           ` Aaron Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wn0bzoeb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63988@debbugs.gnu.org \
    --cc=aaronjensen@gmail.com \
    --cc=me@eshelyaron.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).