guile-devel
[Top][All Lists]
Advanced

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

weak-values gc missed a reference [1.6]


From: Kevin Ryde
Subject: weak-values gc missed a reference [1.6]
Date: Mon, 30 Aug 2004 07:55:41 +1000
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

In my i386 build of the latest 1.6 cvs or the debian 1.6.4-4, the
program below run as "guile -s foo.scm" gives

    ERROR: not-a-record #<freed cell 0x8084f00; GC missed a reference>

I got this in a big program, also using records held as the values in
a weak value hash table.  I think the error is from "rec-foo", with
"x" apparently having become a freed cell.

Being a gc thing it might be sensitive to the exact build environment,
I'm using --with-threads=coop and the default CFLAGS.

It doesn't seem to happen if --debug is added (goes into an infinite
loop instead).  But my big program bombs with --debug too.  I've been
using the cvs head instead mostly, and haven't had any problems there
(build as of a couple of weeks ago for instance).



(define rec-type (make-record-type "foo" '(foo bar quux)))
(define rec-new (record-constructor rec-type))
(define rec-foo (record-accessor rec-type 'foo))

(define h (make-weak-value-hash-table 61))

(hash-set! h "foo" (rec-new (make-vector 1000)
                            (make-vector 1000)
                            (make-vector 1000)))

(let more ()
  (noop)
  (noop)
  (noop)
  (noop)
  (let ((x (hash-ref h "foo")))
    (if x
        (rec-foo x)))
  ;; (gc)
  (if (hash-ref h "foo")
      (more)))




reply via email to

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