From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <phst@google.com>
Cc: chenxinyang99@gmail.com, p.stephani2@gmail.com,
dancol@dancol.org, 65796@debbugs.gnu.org
Subject: bug#65796: dynamic module non_local_exit_get overwrites exit signals
Date: Thu, 07 Sep 2023 13:55:09 +0300 [thread overview]
Message-ID: <83h6o6z20i.fsf@gnu.org> (raw)
In-Reply-To: <CAP-RRPuCAGeyV+aZR5E338Wb5PMWOKqyT6Wt+nBT-yzPGgtP7g@mail.gmail.com> (message from Philipp Stephani on Thu, 7 Sep 2023 12:24:03 +0200)
> From: Philipp Stephani <phst@google.com>
> Date: Thu, 7 Sep 2023 12:24:03 +0200
> Cc: Xinyang Chen <chenxinyang99@gmail.com>, Daniel Colascione <dancol@dancol.org>, 65796@debbugs.gnu.org,
> p.stephani2@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.
prev parent reply other threads:[~2023-09-07 10:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 22:52 bug#65796: dynamic module non_local_exit_get overwrites exit signals Xinyang Chen
2023-09-07 7:07 ` Eli Zaretskii
2023-09-07 10:24 ` Philipp Stephani via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07 10:55 ` Eli Zaretskii [this message]
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=83h6o6z20i.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=65796@debbugs.gnu.org \
--cc=chenxinyang99@gmail.com \
--cc=dancol@dancol.org \
--cc=p.stephani2@gmail.com \
--cc=phst@google.com \
/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).