
Hello , ghc 6.12.3. i use the following code to initialize my haskell dll: extern "C" { #include "HsFFI.h" void __stginit_Main(); void haskell_init (void) { static bool initialized = FALSE; if (!initialized) { initialized = TRUE; hs_init(NULL, NULL); hs_add_root(__stginit_Main); } } } but it crashes on hs_add_root call. what may be source of problem? without hs_add_root, it works ok, but crashes on multiple calls from C to haskell functions, probably due to GC of "unused" code :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hello Bulat, Monday, November 15, 2010, 4:20:14 PM, you wrote:
hs_init(NULL, NULL); hs_add_root(__stginit_Main);
but it crashes on hs_add_root call. what may be source of problem?
just in minutes after presing Send i've found reason of problem. it was due to NULLs passed to hs_init. it was crashed on hs_add_root though that is why i haven't checked this possibility sooner -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (1)
-
Bulat Ziganshin