unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Robin Templeton <robin@terpri.org>
To: 24321@debbugs.gnu.org
Subject: bug#24321: Guardian fails to protect procedure properties
Date: Sat, 27 Aug 2016 15:32:20 -0400	[thread overview]
Message-ID: <87shtqt3cr.fsf@panthera.terpri.org> (raw)

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!






             reply	other threads:[~2016-08-27 19:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27 19:32 Robin Templeton [this message]
2016-09-02  8:10 ` bug#24321: Guardian fails to protect procedure properties Andy Wingo

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=87shtqt3cr.fsf@panthera.terpri.org \
    --to=robin@terpri.org \
    --cc=24321@debbugs.gnu.org \
    /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.
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).