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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Xinyang Chen <chenxinyang99 <at> gmail.com>
Subject: bug#65796: closed (Re: bug#65796: dynamic module non_local_exit_get
 overwrites exit signals)
Date: Fri, 28 Feb 2025 01:16:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#65796: dynamic module non_local_exit_get overwrites exit signals

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 65796 <at> debbugs.gnu.org.

-- 
65796: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65796
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Xinyang Chen <chenxinyang99 <at> gmail.com>
Cc: Philipp Stephani <phst <at> google.com>, Eli Zaretskii <eliz <at> gnu.org>,
 Daniel Colascione <dancol <at> dancol.org>, 65796-done <at> debbugs.gnu.org
Subject: Re: bug#65796: dynamic module non_local_exit_get overwrites exit
 signals
Date: Fri, 28 Feb 2025 02:15:06 +0100

> Am 25.02.2025 um 15:43 schrieb Philipp Stephani <p.stephani2 <at> gmail.com>:
> 
>> 
>> IMO what we should do is: if we fail to allocate, we discard the original signal and replace it with an OOM signal (pointing to constants so requiring no allocation).
> 
> Yeah, that's a good idea, thanks for bringing it up.  I've attached a patch to that effect.

Pushed as commit 32da093e524d5e28945557701f7c50d7c4a898cd.



[Message part 3 (message/rfc822, inline)]
From: Xinyang Chen <chenxinyang99 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: dynamic module non_local_exit_get overwrites exit signals
Date: Wed, 6 Sep 2023 18:52:14 -0400
[Message part 4 (text/plain, inline)]
Currently `module_non_local_exit_get` returns pointers to fields
in emacs_env_private:
```
  if (p->pending_non_local_exit != emacs_funcall_exit_return)
    {
      *symbol = &p->non_local_exit_symbol;
      *data = &p->non_local_exit_data;
    }
```
this means that if one tries to:
```
funcall(...);
non_local_exit_get(&s1, &d1);
funcall(...);
non_local_exit_get(&s2, &d2);
non_local_exit_signal(s1, d1);
```
you would signal the second error, instead of the first error (I expected
this to happen).
It seems to me that `module_non_local_exit_get` should
`allocate_emacs_value` instead.

-Alan
[Message part 5 (text/html, inline)]

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.