[commit: ghc] master: Fix a double-free bug in -fexternal-interpreter (2340485)

git at git.haskell.org git at git.haskell.org
Sat Feb 20 09:51:38 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/234048577efc713a0630c58ebe813dafeaf5deeb/ghc

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

commit 234048577efc713a0630c58ebe813dafeaf5deeb
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.


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

234048577efc713a0630c58ebe813dafeaf5deeb
 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 2c7a501..00601ba 100644
--- a/libraries/ghci/GHCi/TH.hs
+++ b/libraries/ghci/GHCi/TH.hs
@@ -132,7 +132,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