[mercury-users] Crash on MacOS X

Michael Day mikeday at yeslogic.com
Fri Nov 7 13:35:27 AEDT 2008


Hi Peter,

> For us the problem was that we were using the expat C library, but
> telling it to use boehmgc to manage memory.  Anyway it was incorrectly
> calling GC_free at some points and this was somehow confusing the gc.
> So instead we passed to expat a no-op function for freeing memory, and
> allowed boehmgc to decide itself when to free the memory.

That sounds like a really promising line of investigation, and something 
that we definitely could be suffering from.

I can't find any calls to GC_free in our code, and I don't think we are 
currently using boehmgc to allocate memory from C code such as libxml2, 
but I'll take another look and see if anything untoward is going on.

We do have several calls to GC_malloc_atomic for allocating buffers for 
storing images and fonts and a few calls to MR_GC_NEW and MR_GC_malloc 
for allocating structures that contain pointers to buffers.

> We found it by compiling with GC_ASSERTION as a #define.

I'll try this too.

Cheers,

Michael

-- 
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list