chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #1173: Symbols held in GC-roots are sometimes col


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1173: Symbols held in GC-roots are sometimes collected in "symbol-gc" mode
Date: Mon, 22 Aug 2016 21:34:15 -0000

#1173: Symbols held in GC-roots are sometimes collected in "symbol-gc" mode
-----------------------------+-------------------
  Reporter:  felix           |      Owner:
      Type:  defect          |     Status:  new
  Priority:  major           |  Milestone:  5.0
 Component:  core libraries  |    Version:  4.9.x
Resolution:                  |   Keywords:
-----------------------------+-------------------

Comment (by sjamaan):

 OK, my original analysis about the hash table was (of course) completely
 wrong.

 It looks like the problem with the original implementation is that we may
 encounter both the symbol, its bucket container and another item that
 refers to the symbol during minor GC.  These are all copied to the
 fromspace.  Nothing happens to the weak table because it's a minor GC. We
 scan over the bucket, and update the forwarding pointer to the symbol, so
 it points to the symbol in the fromspace.

 Then, a major GC kicks in because fromspace is full.

 We first copy the bucket to tospace.  This enters it into the weak table
 with counter 0, using as item pointer the symbol's location in fromspace.
 Then, the symbol itself is copied and the counter is set to 1.  Then, we
 encounter the other item that refers to the symbol.  However, it still
 refers to the stack location of the symbol, which holds a forwarding
 pointer. The forwarding pointer gets updated, but the symbol's counter
 doesn't get incremented.

 I think a less invasive patch might be possible if we check the weak table
 for an entry for the **forwarded** location while chasing forwarding
 pointers, to handle this case.

--
Ticket URL: <http://bugs.call-cc.org/ticket/1173#comment:13>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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