GNU bug report logs - #65796
dynamic module non_local_exit_get overwrites exit signals

Previous Next

Package: emacs;

Reported by: Xinyang Chen <chenxinyang99 <at> gmail.com>

Date: Thu, 7 Sep 2023 04:59:01 UTC

Severity: normal

Tags: patch

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <phst <at> google.com>
Cc: chenxinyang99 <at> gmail.com, p.stephani2 <at> gmail.com, dancol <at> dancol.org,
 65796 <at> debbugs.gnu.org
Subject: Re: bug#65796: dynamic module non_local_exit_get overwrites exit
 signals
Date: Thu, 07 Sep 2023 13:55:09 +0300
> From: Philipp Stephani <phst <at> google.com>
> Date: Thu, 7 Sep 2023 12:24:03 +0200
> Cc: Xinyang Chen <chenxinyang99 <at> gmail.com>, Daniel Colascione <dancol <at> dancol.org>, 65796 <at> debbugs.gnu.org, 
> 	p.stephani2 <at> gmail.com
> 
> Nice find!
> We can't use allocate_emacs_value here because non_local_exit_get has
> to work in OOM situations and can never fail. What we could do here is
> e.g.:
> - Document the current behavior, stating that the emacs_value objects
> returned from non_local_exit_get are ephemeral. I'm not a huge fan of
> this because it makes non_local_exit_get behave different from all
> other functions.
> - Provide an alternative non_local_exit_copy that copies the 2
> Lisp_Objects into an opaque buffer supplied by the user (plus a way to
> determine the buffer size). That way we shift the responsibility of
> dealing with allocation failures to the user.
> - Attempt to allocate a new emacs_value, fall back to the current
> behavior if that fails. I don't really like that option either because
> it doesn't solve the initial problem in all cases (so users still need
> to deal with it), but makes both the interface and the implementation
> more complex.
> - Crash if we can't allocate memory. That has been rejected in other cases.

I guess just one alternative is acceptable?

> > Btw, the non_local_exit_get function is currently not documented in
> > the ELisp manual; should it be?
> 
> At least in Emacs 29 I see it documented ("Module Nonlocal" node).

I need new glasses.




This bug report was last modified 86 days ago.

Previous Next


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