[GHC] #7160: C finalizers are reversed during GC

GHC cvs-ghc at haskell.org
Tue Aug 21 11:52:59 CEST 2012


#7160: C finalizers are reversed during GC
---------------------------------+------------------------------------------
    Reporter:  int-e             |       Owner:  simonmar                   
        Type:  bug               |      Status:  new                        
    Priority:  high              |   Milestone:  7.6.1                      
   Component:  Runtime System    |     Version:  7.6.1-rc1                  
    Keywords:                    |          Os:  Unknown/Multiple           
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
  Difficulty:  Unknown           |    Testcase:                             
   Blockedby:                    |    Blocking:                             
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by marlowsd@…):

 commit cec899d9fb668d4adccf731a63902e5be49f0660
 {{{
 Author: Simon Marlow <marlowsd at gmail.com>
 Date:   Mon Aug 20 13:52:07 2012 +0100

     Retain ordering of finalizers during GC (#7160)

     This came up since the addition of C finalizers, since Haskell
     finalizers are already stored in an explicit list.  C finalizers on
     the other hand get a WEAK object each, so in order to run them in the
     right order we have to make sure that list stays in the correct
     order.  I hate adding new invariants, but this is the quickest way to
     fix the bug for now.  A better way to fix it would be to have a single
     WEAK object with a list of finaliers attached to it, and a primop
     for adding finalizers to the list.

  rts/sm/MarkWeak.c |   19 ++++++++++++++-----
  1 files changed, 14 insertions(+), 5 deletions(-)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7160#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list