big FFI bug in x86_64

John Meacham john at repetae.net
Thu Apr 21 20:20:05 EDT 2005


ghc 6.4 x86_64 appears to be interpreting 
foreign import "&foo" as importing the value of foo rather than the
address of foo. 

I wrote a test case that demonstrates this problem here
http://repetae.net/john/ghc-bug.tar.gz

correct output: 

;./foo
()
0x080774f0
0x080774f4
0xdeadbeef

incorrect output:

;./foo
()
0x00000000deadbeef
0xffffffffdeadbeef
zsh: segmentation fault (core dumped)  ./foo


This is a pretty major bug. I don't know how the libraries are even
working. 
        John


-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Glasgow-haskell-users mailing list