[cmucl-ticket] #6: GCed items in weak hash tables are still accessible (with random junk)

cmucl cmucl-devel at common-lisp.net
Fri Aug 11 14:08:11 UTC 2006


#6: GCed items in weak hash tables are still accessible (with random junk)
--------------------+-------------------------------------------------------
 Reporter:  rtoy    |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  major   |   Milestone:          
Component:  Core    |     Version:  19c     
 Keywords:          |  
--------------------+-------------------------------------------------------
 Consider this simple transcript:

 {{{
 * (defvar *ht* (make-hash-table :weak-p t))
 *HT*
 * (setf (gethash (list 1) *ht*) (list 2))
 (2)
 * *ht*
 #<EQL hash table, 1 entry>
 * (prog1 t (make-list 1000000))
 T
 * (gc :full t)
 NIL
 * *ht*
 #<EQL hash table, 0 entries>
 * (maphash #'(lambda (k v) (format t "~S -> ~S~%") k v) *ht*)
 (7 . :INSTANCE) -> (#<Function "DEF-STREAM-CLASS SIMPLE-STREAM">)
 }}}

 This is totally bogus.  I think the problem is that when GC cleans up the
 weak entry, it doesn't fill in the entry in the table with the empty
 value.  Instead it remains, and ends up pointing to random objects in
 memory.

-- 
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/6>
cmucl <http://common-lisp.net/project/cmucl>
cmucl


More information about the cmucl-ticket mailing list