On 12 March 2005 15:10, Gabriel Ebner wrote: > If I compile that on amd64 (gentoo, gcc-3.4.3, glibc-2.3.4, > binutils-2.15.92.0.2) using registerised ghc-6.4 and run it, it > segfaults. According to gdb, printf's segfaulting: > > #0 0x00002aaaaafcb515 in printf () from /lib/libc.so.6 > #1 0x0000000000402f3c in frobnicate () at frobnicate.c:4 > #2 0x0000000000402d2d in s1oH_info () > #3 0x0000000000000000 in ?? () > #4 0x0000000000000000 in ?? () > > If I compile it using unregisterised ghc-6.2.2 on the same box or > using ghc-6.4 in a i386 chroot, it runs fine and prints 6378137.
I believe I have fixed this. The problem was that in the registerised build, we weren't maintaining the correct stack alignment for foreign calls, and printf() relies on having the right alignment because it saves the %xmm registers on the stack as part of the varargs magic. Cheers, Simon _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs