all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 30373@debbugs.gnu.org, p.stephani2@gmail.com, sjindel@google.com
Subject: bug#30373: [PATCH] Implement finalizers for module functions (Bug#30373)
Date: Fri, 3 Jan 2020 20:49:35 +0000	[thread overview]
Message-ID: <CAOqdjBeW55vcx1QQNtYGW_hcfmTo4qauaJKOet7onrFC7x9gMA@mail.gmail.com> (raw)
In-Reply-To: <83sgkwguxm.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

On Fri, Jan 3, 2020 at 8:13 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Pip Cet <pipcet@gmail.com>
> > Date: Fri, 3 Jan 2020 18:53:46 +0000
> > Cc: Philipp Stephani <p.stephani2@gmail.com>, 30373@debbugs.gnu.org, sjindel@google.com
> >
> > If I'm reading the test correctly, it depends on garbage-collect
> > actually collecting an unreferenced vector; since our GC's
> > conservative, that might not be working for you, if a word that
> > happens to look like a reference to the vector is still on the stack.
> > (Or it might be something else entirely, but I don't think the test as
> > it stands is correct).
>
> You are probably right, because I see the same failure on GNU/Linux,
> in an x86_64 unoptimized build:

I see it too. Fprogn keeps the value of the first sub-form alive while
evaluating the second one.

We can "fix" Fprogn to discard val early in unoptimized builds, and
that might make GC behavior slightly less surprising.

But it won't properly fix this test.

[-- Attachment #2: 0001-Make-progn-make-huge-vector-garbage-collect-behave-a.patch --]
[-- Type: text/x-patch, Size: 652 bytes --]

From 2c15533cccbcd1622db73362195e86f9c34531e6 Mon Sep 17 00:00:00 2001
From: Pip Cet <pipcet@gmail.com>
Date: Fri, 3 Jan 2020 20:47:50 +0000
Subject: [PATCH] Make (progn (make-huge-vector) (garbage-collect)) behave as
 expected

---
 src/eval.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/eval.c b/src/eval.c
index 66752a397c..eb9018f66a 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -457,6 +457,7 @@ DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0,
 
   while (CONSP (body))
     {
+      /* Don't keep VAL alive unnecessarily (bug#30373).  */
       val = Qnil;
       Lisp_Object form = XCAR (body);
       body = XCDR (body);
-- 
2.24.0


  reply	other threads:[~2020-01-03 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 21:17 bug#30373: Support finalizers for functions created in dynamic modules Samir Jindel
2019-12-23 20:41 ` Philipp Stephani
2019-12-26  0:04   ` bug#30373: [PATCH] Implement finalizers for module functions (Bug#30373) Philipp Stephani
2020-01-03 18:34     ` Philipp Stephani
2020-01-03 18:44       ` Eli Zaretskii
2020-01-03 18:53         ` Pip Cet
2020-01-03 20:13           ` Eli Zaretskii
2020-01-03 20:49             ` Pip Cet [this message]
2020-01-04 19:56               ` Philipp Stephani

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOqdjBeW55vcx1QQNtYGW_hcfmTo4qauaJKOet7onrFC7x9gMA@mail.gmail.com \
    --to=pipcet@gmail.com \
    --cc=30373@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=p.stephani2@gmail.com \
    --cc=sjindel@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.