It's a real bug.  A foreign-exported function is supposed to be
registered as a stable pointer by the initialisation function for a
module (ie. when you call startupHaskell()), but this isn't happening in
5.04.  The result is that eventually the garbage collector collects the
foreign-exported functions, when they should be retained.

One possible workaround is to arrange to register each foreign-exported
function as a stable pointer in your own code.  Or just go back to
5.02.3 for the time being.

We'll fix this bug in 5.04.1, which sadly might have to be sooner rather
than later.

Cheers,
        Simon

> -----Original Message-----
> From: Sigbjorn Finne [mailto:[EMAIL PROTECTED]] 
> Sent: 13 July 2002 15:02
> To: [EMAIL PROTECTED]
> Cc: Mark Tehver
> Subject: Fw: crash with GHC 5.04
> 
> 
> Hi,
> 
> this appears to be GC-related; forwarded to the
> bugs list. Thanks for the report.
> 
> --sigbjorn
> 
> ----- Original Message -----
> From: "Mark Tehver" <[EMAIL PROTECTED]>
> To: "Sigbjorn Finne" <[EMAIL PROTECTED]>
> Sent: Saturday, July 13, 2002 07:38
> Subject: crash with GHC 5.04
> 
> 
> > Hi again,
> >
> > I have run into another problem that I believe may be a bug 
> in GHC 5.04.
> > Perhaps I should post this to ghc-bugs mailing list as I am not sure
> > if it is a Windows specific issue or something more general.
> >
> > Anyway, the problem is that the example I have attached to this mail
> > crashes. It is a relatively simple example (I encountered a
> > similar problem in a larger program and tried to simplify 
> the issue as
> > much as possible), the C++ program calls several functions that are
> > exported from Haskell. For some reason, crash occours in loop
> > interation 32. This does not seem to be C compiler problem 
> as it happends
> > with both MS VC and GCC. The program does not crash when I 
> use GHC 5.02.3.
> >
> > Mark
> >
> 
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to