Subject: Re: bug#30373: [PATCH] Implement finalizers for module functions (Bug#30373)

From: Pip Cet <[email-masked]>
Date: Fri, 3 Jan 2020 18:53:46 +0000

On Fri, Jan 3, 2020 at 6:45 PM Eli Zaretskii <[email-masked]> wrote:
> The new test fails for me on MS-Windows:
>
>   Test module/function-finalizer backtrace:
>     signal(ert-test-failed (((should (equal (mod-test-function-finalizer
>     ert-fail(((should (equal (mod-test-function-finalizer-calls) expecte
>     (if (unwind-protect (setq value-370 (apply fn-368 args-369)) (setq f
>     (let (form-description-372) (if (unwind-protect (setq value-370 (app
>     (let ((value-370 'ert-form-evaluation-aborted-371)) (let (form-descr
>     (let* ((fn-368 #'equal) (args-369 (condition-case err (let ((signal-
>     (let* ((previous-calls (mod-test-function-finalizer-calls)) (expecte
>     (closure (t) nil (mod-test-make-function-with-finalizer) (let* ((pre
>     ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
>     ert-run-test(#s(ert-test :name module/function-finalizer :documentat
>     ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
>     ert-run-tests((not (tag :unstable)) #f(compiled-function (event-type
>     ert-run-tests-batch((not (tag :unstable)))
>     ert-run-tests-batch-and-exit((not (tag :unstable)))
>     eval((ert-run-tests-batch-and-exit '(not (tag :unstable))) t)
>     command-line-1((#("-L" 0 2 (charset cp862)) #(";." 0 2 (charset cp86
>     command-line()
>     normal-top-level()
>   Test module/function-finalizer condition:
>       (ert-test-failed
>        ((should
>          (equal
>           (mod-test-function-finalizer-calls)
>           expected-calls))
>         :form
>         (equal
>          (0 0)
>          (1 0))
>         :value nil :explanation
>         (list-elt 0
>                   (different-atoms
>                    (0 "#x0" "? ")
>                    (1 "#x1" "? ")))))
>      FAILED  26/27  module/function-finalizer (0.109375 sec)

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).