chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] #1112: Figure out a way to safely release objects


From: Chicken Trac
Subject: [Chicken-janitors] #1112: Figure out a way to safely release objects
Date: Wed, 16 Apr 2014 15:11:17 -0000

#1112: Figure out a way to safely release objects
----------------------------+-----------------------------------------------
 Reporter:  sjamaan         |       Owner:        
     Type:  defect          |      Status:  new   
 Priority:  critical        |   Milestone:  4.10.0
Component:  core libraries  |     Version:  4.8.x 
 Keywords:                  |  
----------------------------+-----------------------------------------------
 The {{release-object}} procedure will just call {{free()}} on the object's
 pointer.  This means that any Scheme variable still referring to the
 object will now point to free memory, which may get overwritten with
 arbitrary values.

 The GC will not touch memory outside the heap, but it's possible that the
 freed object's memory gets "pulled in" when resizing the heap upon major
 GC, which means the GC's tests for whether it's in the heap space will
 succeed, causing it to treat the object as "valid", even if something else
 has temporarily written bogus stuff to that memory space in between.

 We need a way for the GC to kill all references to the released object,
 but this is currently impossible: these references are plain pointers, and
 there is no way to ensure a GC won't find any references to these objects.

 The trick used by object-become is to collect these objects on a special
 stack, and force a major GC, which then treats these objects specially.
 This is probably too much of performance impact though, because object-
 evict generally tends to be used for performance reasons.

 Perhaps some form of "weak evicted object pointers" can be introduced?

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/1112>
CHICKEN Scheme <http://www.call-with-current-continuation.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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