Re[2]: [Gc] crash in GC_free

Ivan Maidanski ivmai at mail.ru
Tue Jun 2 08:46:02 PDT 2009


Hi!

Jerry Hughes <hughesjerry369 at gmail.com> wrote:
> Hi,
> 
> I haven't managed to build gc v6.8 on my Mac. I get that when I try  
> and build it :
> ../darwin_stop_world.c: In function 'GC_push_all_stacks':
> ../darwin_stop_world.c:105: error: 'i386_thread_state_t' has no member  
> named 'esp'
> ../darwin_stop_world.c:107: error: 'i386_thread_state_t' has no member  
> named 'eax'
> ../darwin_stop_world.c:108: error: 'i386_thread_state_t' has no member  
> named 'ebx'
> ../darwin_stop_world.c:109: error: 'i386_thread_state_t' has no member  
> named 'ecx'
> ../darwin_stop_world.c:110: error: 'i386_thread_state_t' has no member  
> named 'edx'
> ../darwin_stop_world.c:111: error: 'i386_thread_state_t' has no member  
> named 'edi'
> ../darwin_stop_world.c:112: error: 'i386_thread_state_t' has no member  
> named 'esi'
> ../darwin_stop_world.c:113: error: 'i386_thread_state_t' has no member  
> named 'ebp'

Yes. That version (thread support, to be precise) is for older OS X.

Do You need thread support. If not, try without -DGC_THREADS.

OK. Revert back to v7.1 (or, better, fetch the latest CVS snapshot - is should be safer than any of v7 versions).

> 
> I tried test.c That seemed to be a good idea, I got an error:  
> "GC_is_visible produced wrong failure indication"

This means the problem is in the gc itself.

Your Mac is not on PPC, right?

> 
> If I just include gc.h, I get the same problem.
> 
> What is "bt"? I guess you'd like some more debugging info. Actually, I  
> don't know how the debugger got me all the info. It did only a couple  
> times. Now I only have the compiled code and the stack saying it  
> crashed in GC_free. The couple times I got full debugging info, hhdr  
> was null and that crashed on line 412:     sz = hhdr -> hb_sz;

"bt" is gdb "backrace" command. It shows calls stack for the current thread.

> 
> There is no use of the garbage collector at all in my code. I just  
> tried and call GC_init(). But with or without that call it crashes the  
> same.

Do You define GC_[P]THREADS (before including gc.h)?

Who calls GC_free() (which crashes) in your app? Use gdb "bt" for this.

> 
> I am not extending Qt. I use the LGPL Qt 4.5 libraries.
> 
> Jerry
> 
> > ...

Bye.


More information about the Gc mailing list