Sigbjorn Finne writes:
> Looks like a ghc problem (with 4.04, at least) - Cc'ing the
> ghc-bugs list in case anyone there wants to track down why
> (nfib 20) crashes when called via 'foreign export' (the
> program in question can be found in hdirect/examples/server/.)
This one is the same bug as that reported by Martin Kowalczyk (namely that
foreign exported functions can be garbage collected). For now, the
workaround is to explicitly call makeStablePtr from Haskell on the
foreign-exported functions.
Cheers,
Simon