[GHC] #2161: finaliser of a ForeignPtr called while references from unreachable threads exist

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


#2161: finaliser of a ForeignPtr called while references from unreachable threads
exist
------------------------------------------+---------------------------------
  Reporter:  agl                          |          Owner:                  
      Type:  bug                          |         Status:  closed          
  Priority:  low                          |      Milestone:  7.6.2           
 Component:  Runtime System               |        Version:  6.8.2           
Resolution:  duplicate                    |       Keywords:                  
        Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple
   Failure:  Incorrect result at runtime  |     Difficulty:  Unknown         
  Testcase:                               |      Blockedby:                  
  Blocking:                               |        Related:                  
------------------------------------------+---------------------------------

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/2161#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list