[GHC] #14346: 8.2.1 regression: heap corruption after safe foreign calls

GHC ghc-devs at haskell.org
Wed Oct 18 03:32:18 UTC 2017


#14346: 8.2.1 regression: heap corruption after safe foreign calls
-------------------------------------+-------------------------------------
        Reporter:  andrewchen        |                Owner:  (none)
            Type:  bug               |               Status:  infoneeded
        Priority:  highest           |            Milestone:
       Component:  Runtime System    |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime crash     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by hsyl20):

 Smaller reproducer:

 {{{#!haskell
 -- ghc -Wall -fforce-recomp -O1 Test.hs -threaded
 module Main where

 import Control.Concurrent
 import Control.Monad
 import Data.Word
 import Foreign.Marshal.Alloc
 import Foreign.Storable
 import Numeric

 main :: IO ()
 main = do
     replicateM_ 100 $ threadDelay 100
     allocaBytes 4 $ \p -> do
       forever $ do
         poke p (0xDEADBEEF :: Word32)
         threadDelay 10
         x <- peek p
         unless (x == 0xDEADBEEF) $ putStrLn (showHex x "")

 }}}

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


More information about the ghc-tickets mailing list