[GHC] #3971: ghc-pkg list segfaults in ghc-6.12.1.20100330
GHC
cvs-ghc at haskell.org
Sat Apr 10 20:56:31 EDT 2010
#3971: ghc-pkg list segfaults in ghc-6.12.1.20100330
---------------------------+------------------------------------------------
Reporter: wkahl | Owner:
Type: bug | Status: new
Priority: normal | Component: Package system
Version: 6.12.1 RC1 | Keywords:
Os: Linux | Testcase:
Architecture: powerpc | Failure: None/Unknown
---------------------------+------------------------------------------------
Comment(by wkahl):
The
[http://www.haskell.org/haskellwiki/GHC/Using_the_FFI#Callbacks_into_Haskell_from_foreign_code
CallBacker] example segfaults, too, both with GHC-6.10.4 and
GHC-6.12.1.20100330.
I then changed main slightly:
{{{
main :: IO ()
main = do
squareW <- wrap square -- make function pointer from the function
putStrLn "got squareW"
let x = 4
y <- twice squareW x -- use the foreign function with our callback
print y -- see that it worked
z <- twice squareW y
print z
freeHaskellFunPtr squareW -- clean up after ourselves
}}}
Running this produces:
{{{
./CallBacker
got squareW
Segmentation fault
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3971#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list