Segmentation fault in program

Simon Marlow simonmar at microsoft.com
Tue Feb 13 10:06:15 EST 2001


GC problems sometimes result from the wrong __init_Foo being passed to
startupHaskell.  The symbol you pass in must relate to the topmost
module in your program; all other modules must be directly or indirectly
imported by the topmost module.

If you're sure this is the case, could you send me the code and I'll
take a look.

Cheers,
	Simon

> -----Original Message-----
> From: Sigbjorn Finne [mailto:sigbjorn_finne at hotmail.com]
> Sent: Monday, February 12, 2001 8:07 PM
> To: T.J. Brown
> Cc: glasgow-haskell-bugs at haskell.org
> Subject: Re: Segmentation fault in program
> 
> 
> I'm able to reproduce this here too -- forwarded
> to glasgow-haskell-bugs; I'm no longer involved
> debugging GHC bits.
> 
> --sigbjorn
> 
> ----- Original Message ----- 
> From: "T.J. Brown" <t_j_b_2 at yahoo.com>
> To: "Sigbjorn Finne" <sigbjorn_finne at hotmail.com>
> Sent: Monday, February 12, 2001 19:21
> Subject: Re: Segmentation fault in program
> 
> 
> > After making the changes suggested below and updating
> > the GHC driver script to fix the -no-hs-main bug, my
> > program will successfully complete when processing a
> > small amount of data.  When processing larger amounts
> > of data, however, it will crash with a segmentation
> > fault or print "EVACUATED object entered".  If I
> > increase the size of the heap with "+RTS -H<size>" the
> > program will complete successfully.  It doesn't seem
> > like the garbage collector is doing the right thing.
> > Is there something I need to do to enable the garbage
> > collector to free memory between subsequent calls to
> > the my Haskell function (Convert)?
> > 
> > Thanks,
> > T.J.
> > --- Sigbjorn Finne <sigbjorn_finne at hotmail.com> wrote:
> > > Hi,
> > >
> > > your converttst.c contains the following decl:
> > >
> > > extern void startupHaskell (int argc, char* argv[],
> > > void* rootMod);
> > > void* __init_Main;
> > >
> > > That won't work, as the root module argument needs
> > > to point to
> > > something valid. Rewrite it to:
> > >
> > > extern void startupHaskell (int argc, char* argv[],
> > > void* rootMod);
> > > extern void* __init_Convert;
> > >
> > > and substitute __init_Main with __init_Convert
> > > wherever it is used
> > > in the C code.
> > >
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail - only $35
> > a year!  http://personal.mail.yahoo.com/
> > 
> 
> _______________________________________________
> Glasgow-haskell-bugs mailing list
> Glasgow-haskell-bugs at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
> 




More information about the Glasgow-haskell-bugs mailing list