Re: [Gc] crash in GC_free

Ivan Maidanski ivmai at
Tue Jun 2 06:46:30 PDT 2009


Jerry Hughes <hughesjerry369 at> wrote:
> Hi,
> I want to use the C++ gc in a code I wrote on a Mac OS 10.5 using Qt.  
> The code doesn't use delete at all as it was meant to be garbage  
> collected. The code obviously has leaks but works fine otherwise.
> I build gc 7.1 on my Mac. The test_cpp runs fine.

Have You tried gc v6.8? Have You tried test.c?

> In my code, all I did was including "gc_cpp.h" and now the program  
> crashes quite immediately after launch. Apparently somewhere in  
> GC_free() from malloc.c because hhdr is null.

If You would include just "gc.h" (instead of "gc_cpp.h"), does this lead to a crash too?

Could You show "bt" containing GC_free call.

> It crashes even if not a single class is derived yet from gc. So, I  
> don't understand why GC_free is even called.

Is GC_[generic_]malloc() (or friends) ever called (even indirectly) before the crash?

> Is it because I use Qt libraries which are not garbage collected?

Are You extending Qt classes?

> Thanks,
> Jerry


More information about the Gc mailing list