From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65796: dynamic module non_local_exit_get overwrites exit signals Date: Thu, 07 Sep 2023 13:55:09 +0300 Message-ID: <83h6o6z20i.fsf@gnu.org> References: <8334zq1mx6.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30720"; mail-complaints-to="usenet@ciao.gmane.io" Cc: chenxinyang99@gmail.com, p.stephani2@gmail.com, dancol@dancol.org, 65796@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 07 12:56:07 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qeCgA-0007jL-63 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Sep 2023 12:56:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeCg5-0005Zp-CG; Thu, 07 Sep 2023 06:56:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeCg4-0005ZU-Dl for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 06:56:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeCg4-0006FK-5s for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 06:56:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qeCg5-0006MD-Ny for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 06:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Sep 2023 10:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65796 X-GNU-PR-Package: emacs Original-Received: via spool by 65796-submit@debbugs.gnu.org id=B65796.169408413624405 (code B ref 65796); Thu, 07 Sep 2023 10:56:01 +0000 Original-Received: (at 65796) by debbugs.gnu.org; 7 Sep 2023 10:55:36 +0000 Original-Received: from localhost ([127.0.0.1]:38733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeCff-0006LZ-Iy for submit@debbugs.gnu.org; Thu, 07 Sep 2023 06:55:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeCfa-0006LJ-OP for 65796@debbugs.gnu.org; Thu, 07 Sep 2023 06:55:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeCfT-00061O-3z; Thu, 07 Sep 2023 06:55:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=w05iH/8akOLHstJpHJstWmKEG9B7AXKQAJWYAubEtP8=; b=F/WBy237w0RX s5wOyjB8R0apQIxJgRZq89ZUZl988Zd8qhwcnguei/RFumqkayCH2Me5UbNs+yQCmKem180soZBbI zuDlXdfE0OD8rsIl0JByi/1HQQk4W+mHaMdDdH1v4y6AnsLHkRMH4QclBIj6PdVAxx/ZPJ31y0ICg Wu+dh4MSzhEgXdT7NlEQl/709j8yLZvtMFt6eFDMRr+1AM8E0x5+Xh/VNej39O1d9hxpXtnn+fmP9 LM3nrEMfwT9JD2VGpVlldfHEg5GIE4dXa1MmgPP5wUfDODqyycetgzjPxHSlj+s8lXWi8oBwv06oL lcl9mXrGpLcI+AQQ65nWpw==; In-Reply-To: (message from Philipp Stephani on Thu, 7 Sep 2023 12:24:03 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269641 Archived-At: > From: Philipp Stephani > Date: Thu, 7 Sep 2023 12:24:03 +0200 > Cc: Xinyang Chen , Daniel Colascione , 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.