
On 9/23/06, Stephan Walter
I'm trying to use a shared lib written in Haskell to overload C functions via LD_PRELOAD. [snip] This aborts with a segfault in scheduleWaitThread() from ./libtestffi.so
The test program doesn't use threads, so I'm wondering what I did wrong?
From http://www.haskell.org/ghc/docs/latest/html/users_guide/sec-ffi-ghc.html#usi...: The call to hs_init() initializes GHC's runtime system. Do NOT try to invoke any Haskell functions before calling hs_init(): strange things will undoubtedly happen.
If you are using gcc you can add something like this when linking libtestffi.so:
#include