From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xinyang Chen Newsgroups: gmane.emacs.bugs Subject: bug#65796: dynamic module non_local_exit_get overwrites exit signals Date: Wed, 6 Sep 2023 18:52:14 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d51bc30604b89823" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37564"; mail-complaints-to="usenet@ciao.gmane.io" To: 65796@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 07 06:59:15 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 1qe76o-0009bX-9F for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Sep 2023 06:59:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qe76g-0003Jn-5a; Thu, 07 Sep 2023 00:59:06 -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 1qe76b-0003Hr-DR for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 00:59:01 -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 1qe76b-0005cJ-52 for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 00:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qe76c-0002e6-4V for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 00:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Xinyang Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Sep 2023 04:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65796 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169406272210142 (code B ref -1); Thu, 07 Sep 2023 04:59:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Sep 2023 04:58:42 +0000 Original-Received: from localhost ([127.0.0.1]:38293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qe76G-0002dV-Mf for submit@debbugs.gnu.org; Thu, 07 Sep 2023 00:58:42 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:38400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qe1O0-0001w6-Hb for submit@debbugs.gnu.org; Wed, 06 Sep 2023 18:52:51 -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 1qe1Nt-0002y7-Qz for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 18:52:29 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qe1Nr-0004dq-Jn for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 18:52:29 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5008faf4456so476971e87.3 for ; Wed, 06 Sep 2023 15:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694040745; x=1694645545; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=UEGDdO1L0h3GqkNVTA7xe3xYmYuPQ6k7cPE2FglE94g=; b=RplZt4rnN+ohxxmfyNWqX75hEUk8Grlu3xwY56fKKDc4LX1Z06mT4PtciMq8BTPN1t ezi11DqnywJ2H7ReA7FXx3Psq/E2nfkPJc8RbUXzv4n45eGF653tA0FOYqked9cuI3PV XUR57pfg8VnJZArf65O52bWqz3vu9JOY+GTPucuu7TEYDmpeUa/Oa+F/2w4VpDsC89p6 c4wQ7mNcnTk4eSvTkAV98+VgfTTlMFJpMksDBL4t57ykteQ4ubno2eNysJgN7uLry3FW TKhBgglM/D0wEDOqw8Y3R08k+sGMzIUuRXx54Q1Cc4vq9wjqvnrmnRYpJY0yTt09y1G9 2DyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694040745; x=1694645545; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UEGDdO1L0h3GqkNVTA7xe3xYmYuPQ6k7cPE2FglE94g=; b=dqp6+hRAixZU55YW4jJibUbVu6KP8bUoJUISR0Wr8/NX4GUcw41dV3+r/tRWR3KRHa p01tMb/jnFMjyoY8zNJQODouP5ZXfSzq7bC+8Fj6J1hTazoHF8ozrmYEdQlKulZX+1ZX NgQIS+gkayRtw/khUi/4f3WfBer/ERPpArKD0HM7klHrlqasIhTIpk8AP0XZSuVzW211 8dZctM9sPLS6dZAa3c95b9TdDQxPouSCdis1dLnyHV4SjUOM8IIVJ4Dn5oqCl3W6gOMc x0PhsYEvUecivy90LcriLbHO22ceHXNR3omnkbqXYgVwW/SRtKIpYSrAtIPcL3369ORT 09zA== X-Gm-Message-State: AOJu0Yw2y+3DTdIyF67tKTPL0rT/CXc1/VbmhXTNtS/EOW2elfKvuAkj FasoUguBhGmMXd77qeILoSSplP8gtURXOKsBKXjBM7+o8QwldQ== X-Google-Smtp-Source: AGHT+IHpVKT6FbIDG/m6WrLPr1fIKiHtxmlUV25GrILNDhJj1dpTcaP35he2zM78YxW4I7CcY7fvxBiNHbDzow0/okg= X-Received: by 2002:ac2:4830:0:b0:500:bf33:3add with SMTP id 16-20020ac24830000000b00500bf333addmr3195110lft.47.1694040744858; Wed, 06 Sep 2023 15:52:24 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=chenxinyang99@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 07 Sep 2023 00:58:39 -0400 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:269602 Archived-At: --000000000000d51bc30604b89823 Content-Type: text/plain; charset="UTF-8" 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 --000000000000d51bc30604b89823 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Currently=C2=A0`module_non_local_exit_get` returns=C2=A0po= inters to fields in=C2=A0emacs_env_private:
```
=C2=A0 if (p-= >pending_non_local_exit !=3D emacs_funcall_exit_return)
=C2=A0 =C2=A0= {
=C2=A0 =C2=A0 =C2=A0 *symbol =3D &p->non_local_exit_symbol;=C2=A0 =C2=A0 =C2=A0 *data =3D &p->non_local_exit_data;
=C2=A0 = =C2=A0 }
```
this means that if one tries to:
`= ``
funcall(...);
non_local_exit_get(&s1, &d1);
funcall(...);
non_local_exit_get(&s2, &d= 2);
non_local_exit_signal(s1, d1);
```
you would=C2=A0signal 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
--000000000000d51bc30604b89823--