[commit: ghc] ghc-8.0: Fix a double-free bug in -fexternal-interpreter (892de05)

git at git.haskell.org git at git.haskell.org
Sat Feb 20 15:31:57 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/892de051aaaf9a346dadc74592a9cc375b3223a4/ghc

>---------------------------------------------------------------

commit 892de051aaaf9a346dadc74592a9cc375b3223a4
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Sat Feb 20 07:39:34 2016 +0000

    Fix a double-free bug in -fexternal-interpreter
    
    Originally I planned to make this reference manually managed, but it
    looks like at some point I gave it a finalizer on the GHC side, but
    forgot to remove the manual free here.  The result is that ghc-iserv
    could crash in getStablePtr sometimes when using TH.
    
    (cherry picked from commit 234048577efc713a0630c58ebe813dafeaf5deeb)


>---------------------------------------------------------------

892de051aaaf9a346dadc74592a9cc375b3223a4
 libraries/ghci/GHCi/TH.hs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libraries/ghci/GHCi/TH.hs b/libraries/ghci/GHCi/TH.hs
index 26a6d9f..34d6fad6 100644
--- a/libraries/ghci/GHCi/TH.hs
+++ b/libraries/ghci/GHCi/TH.hs
@@ -133,7 +133,6 @@ finishTH pipe rstate = do
   qstateref <- localRef rstate
   qstate <- readIORef qstateref
   _ <- runGHCiQ runModFinalizers qstate { qsPipe = pipe }
-  freeRemoteRef rstate
   return ()
 
 runTH



More information about the ghc-commits mailing list