Segmentation fault in program

Simon Marlow simonmar at microsoft.com
Fri Feb 9 07:04:53 EST 2001


>
> However, if you recompile and link, I believe you'll see it crashing
> even more regularly - I suspect this is due to a bug in the GHC
> RTS (at least 4.08.1's, don't know if 4.08.2 has fixed this) Attached
> is a simpler program that shows up the problem.

Try adding an extra & before __init_Foo, like so:

    startupHaskell(argc,argv,&__init_Foo);

It'll now work.  We've been a bit misleading in declaring the type of
this argument as "void *", since if you declare a variable of this type
it won't work - you need to declare it as a function and cast to (void
*).

Cheers,
	Simon




More information about the Glasgow-haskell-bugs mailing list