unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#24321: Guardian fails to protect procedure properties
@ 2016-08-27 19:32 Robin Templeton
  2016-09-02  8:10 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Templeton @ 2016-08-27 19:32 UTC (permalink / raw)
  To: 24321

The following expression produces possibly erroneous results in Guile
2.1.3.104-8f2f8 (with Debian's libgc1c2 version 1:7.4.2-8):

(let ((guardian (make-guardian))
      (foo (eval '(lambda () #f) (interaction-environment))))
  (set-procedure-property! foo 'wibbly 'wobbly)
  (guardian foo)
  (format #t "~S~%" (procedure-properties foo))
  (set! foo #f)
  (gc)
  (do ((foo (guardian) (guardian)))
      ((not foo))
    (format #t "~S~%" (procedure-properties foo))))

First it prints "((wibbly . wobbly))" as expected, but after the
procedure is retrieved from the guardian the list of properties is
empty. The properties are stored in a weak hash table, but shouldn't
they be protected from GC while the procedure is in the guardian?

-- 
Inteligenta persono lernas la lingvon Esperanton rapide kaj facile.
Esperanto estas moderna, kultura lingvo por la mondo. Simpla, fleksebla,
belsona, Esperanto estas la praktika solvo de la problemo de universala
interkompreno. Lernu la interlingvon Esperanton!






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#24321: Guardian fails to protect procedure properties
  2016-08-27 19:32 bug#24321: Guardian fails to protect procedure properties Robin Templeton
@ 2016-09-02  8:10 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2016-09-02  8:10 UTC (permalink / raw)
  To: Robin Templeton; +Cc: 24321

On Sat 27 Aug 2016 21:32, Robin Templeton <robin@terpri.org> writes:

> The following expression produces possibly erroneous results in Guile
> 2.1.3.104-8f2f8 (with Debian's libgc1c2 version 1:7.4.2-8):
>
> (let ((guardian (make-guardian))
>       (foo (eval '(lambda () #f) (interaction-environment))))
>   (set-procedure-property! foo 'wibbly 'wobbly)
>   (guardian foo)
>   (format #t "~S~%" (procedure-properties foo))
>   (set! foo #f)
>   (gc)
>   (do ((foo (guardian) (guardian)))
>       ((not foo))
>     (format #t "~S~%" (procedure-properties foo))))
>
> First it prints "((wibbly . wobbly))" as expected, but after the
> procedure is retrieved from the guardian the list of properties is
> empty. The properties are stored in a weak hash table, but shouldn't
> they be protected from GC while the procedure is in the guardian?

Related to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=10836.

Andy





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-02  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-27 19:32 bug#24321: Guardian fails to protect procedure properties Robin Templeton
2016-09-02  8:10 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).