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

GHC ghc-devs at haskell.org
Wed Oct 18 01:02:56 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):

 You don't need the FFI to trigger the bug. You can replace:

 {{{#!haskell
 foreign import ccall safe "test"
     c_test :: Ptr Word32 -> IO ()
 }}}

 with:

 {{{#!haskell
 {-# NOINLINE c_test #-}
 c_test :: Ptr Word32 -> IO ()
 c_test ptr = poke ptr 0xDEADBEEF
 }}}

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


More information about the ghc-tickets mailing list