GNU bug report logs - #63253
29.0.90; with-delayed-message fails in combination with inhibit-message

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Wed, 3 May 2023 19:56:02 UTC

Severity: normal

Found in version 29.0.90

Done: Daniel Mendler <mail <at> daniel-mendler.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 63253 <at> debbugs.gnu.org
Subject: bug#63253: 29.0.90; with-delayed-message fails in combination with inhibit-message
Date: Mon, 08 May 2023 09:54:35 -0400
> There seems to exist an interaction issue of `with-delayed-message' with
> `inhibit-message'.

Very much so, indeed.  The issue is fundamentally linked to
`set-message-function`:

`with-delayed-message` calls `message3` (via
`with_delayed_message_display`) from an "atimer", i.e. a thing that can
be run from `process_pending_signals`, `unblock_input`, `maybe_quit`, ...

AFAIK these are places where it's safe to run some C code, but not
places where it's safe to run arbitrary ELisp code.

So `set-message-function` is "dangerous" because it runs ELisp code from
`message3` => `message3_nolog` => `set_message`.

I think this is related to bug#58042.

Here the problem is that the regexp engine is stateful, so calling
a regexp function in the middle of another regexp match causes serious
problems.  When we need to run ELisp from a regexp match for
on-the-fly syntax-propertization (in `parse_sexp_propertize`), we're
careful to try and detect if the ELisp code may have modified the
current buffer and we re-set the `gl_state` with a call to
`SETUP_SYNTAX_TABLE`.

But when `with-delayed-message' performs a regexp operation from within
another regexp match, it doesn't re-set the `gl_state`, which then leads
to this "Error in syntax_table logic for to-the-end intervals" error.

I'm surprised we haven't yet seen the same problem when the ELisp code is
run via things like -[EmacsView layoutSublayersOfLayer:] which can be
called from `maybe_quit` and call `redisplay` which in turn can run
arbitrary ELisp code (via `mode-line-format`, jit-lock, you name it).


        Stefan





This bug report was last modified 174 days ago.

Previous Next


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