[GHC] #7970: Thread GC frees roots before thread actually finishes

GHC ghc-devs at haskell.org
Tue Jul 2 13:13:58 CEST 2013


#7970: Thread GC frees roots before thread actually finishes
---------------------------------+------------------------------------------
    Reporter:  joeyadams         |       Owner:  simonmar        
        Type:  bug               |      Status:  new             
    Priority:  high              |   Milestone:  7.8.1           
   Component:  Runtime System    |     Version:  7.6.3           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  Runtime crash   
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:  7170              |  
---------------------------------+------------------------------------------

Comment(by marlowsd@…):

 commit 1ae72ac45e51e63cbf6f3d627d77acc6a36aa0f9
 {{{
 Author: Simon Marlow <marlowsd at gmail.com>
 Date:   Tue Jul 2 12:10:53 2013 +0100

     Fix #7970, #2161, unfix #551

     Establish the reachability of threads before weak pointers.  Hence a
     deadlocked thread can keep a weak pointer alive and prevent it from
     being finalized early.  However, an reference from the finalizer of a
     weak pointer will no longer prevent a thread from being considered
     deadlocked (#551).  To keep the thread alive in that situation you
     need to use a StablePtr.

     See comments on #7970 and in the code for more details.

  rts/sm/MarkWeak.c |  100
 +++++++++++++++++++++++++++-------------------------
  1 files changed, 52 insertions(+), 48 deletions(-)
 }}}

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



More information about the ghc-tickets mailing list