emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#26503: closed (Local variables reclaimed early vs.


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#26503: closed (Local variables reclaimed early vs. finalizers)
Date: Wed, 19 Apr 2017 12:25:02 +0000

Your message dated Wed, 19 Apr 2017 14:23:59 +0200
with message-id <address@hidden>
and subject line Re: bug#26503: Local variables reclaimed early vs. finalizers
has caused the debbugs.gnu.org bug report #26503,
regarding Local variables reclaimed early vs. finalizers
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
26503: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26503
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Local variables reclaimed early vs. finalizers Date: Fri, 14 Apr 2017 23:56:50 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
Hello!

Consider this code:

--8<---------------cut here---------------start------------->8---
(use-modules (system foreign))

(define %table
  (make-weak-value-hash-table))

(define %abort
  (dynamic-func "abort" (dynamic-link)))

(let ((ptr (make-pointer 123 %abort)))
  (display "hello\n")
  (gc))
--8<---------------cut here---------------end--------------->8---

Guile is free to collect ‘ptr’ when ‘gc’ is called since it has become
unreachable at that point; that’s what 2.2.0 does, as explained in
‘NEWS’.

However, there’s a finalizer here so collecting ‘ptr’ has an observable
side effect.  This side effect makes the semantic change visible: the
“expected” semantics would be that ‘ptr’ is not subject to GC while it’s
in scope.

(In 2.0 the finalizer is not called until ‘ptr’ is no longer in scope.)

I’m not sure this counts as a bug, but it’s certainly a pitfall when
working with finalizers and the FFI.

Thoughts?

Ludo’.



--- End Message ---
--- Begin Message --- Subject: Re: bug#26503: Local variables reclaimed early vs. finalizers Date: Wed, 19 Apr 2017 14:23:59 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
On Wed 19 Apr 2017 11:50, address@hidden (Ludovic Courtès) writes:

> I need to chew a bit more on this, but the conclusion is probably that
> my expectations were incorrect, indeed.  :-)

OK I close this bug in the meantime then :)  Feel free to reopen if
there is a thing to do!

Andy


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]