[Gc] MacOS 10.4 failure

S M Ryan wyrmwif at rawbw.com
Sun Feb 11 21:31:37 PST 2007


I'm getting aborts, apparently in darwin_stop_world. I thought I  
applied MACHINE_THREAD_STATE patch, but I've lost track of what I'm  
supposed to be compiling. I've included the state of things here. If  
some kind soul could point to me the right place if I'm out of date.  
Currently I have to GC_no_gc =1 to get anything done.

MacOS 10.4 i386

Xcode 2.4

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Sample compile with all -D defines

gcc -DPACKAGE_NAME=\"gc\" -DPACKAGE_TARNAME=\"gc\" -DPACKAGE_VERSION= 
\"6.8\" "-DPACKAGE_STRING=\"gc 6.8\"" -DPACKAGE_BUGREPORT= 
\"Hans.Boehm at hp.com\" -DGC_VERSION_MAJOR=6 -DGC_VERSION_MINOR=8 - 
DPACKAGE=\"gc\" -DVERSION=\"6.8\" -DGC_DARWIN_THREADS=1 - 
DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 - 
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 - 
DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 - 
DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSILENT=1 - 
DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 - 
DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -I./ 
include -fexceptions -g -O2 -arch i386 -isysroot /Developer/SDKs/ 
MacOSX10.4u.sdk -fexceptions -MT allchblk.lo -MD -MP -MF .deps/ 
allchblk.Tpo -c allchblk.c  -fno-common -DPIC -o .libs/allchblk.lo

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

darwin_stop_world.c:170

void GC_push_all_stacks() {
     int i;
	task_t my_task;
     kern_return_t r;
     mach_port_t me;
     ptr_t lo, hi;
     thread_act_array_t act_list = 0;
     mach_msg_type_number_t listcount = 0;

     me = mach_thread_self();
     if (!GC_thr_initialized) GC_thr_init();

	my_task = current_task();
     r = task_threads(my_task, &act_list, &listcount);
     if(r != KERN_SUCCESS) ABORT("task_threads failed");
     for(i = 0; i < listcount; i++) {
       thread_act_t thread = act_list[i];
       if (thread == me) {
	lo = GC_approx_sp();
	hi = (ptr_t)FindTopOfStack(0);
       } else {
#     if defined(POWERPC)
#      if CPP_WORDSZ == 32
	ppc_thread_state_t info;
#      else
	ppc_thread_state64_t info;
#      endif
	mach_msg_type_number_t outCount = THREAD_STATE_MAX;
	r = thread_get_state(thread, MACHINE_THREAD_STATE,
			     (natural_t *)&info, &outCount);
	if(r != KERN_SUCCESS) ABORT("task_get_state failed");

	lo = (void*)(info.r1 - PPC_RED_ZONE_SIZE);
	hi = (ptr_t)FindTopOfStack(info.r1);

	GC_push_one(info.r0);
	GC_push_one(info.r2);
	GC_push_one(info.r3);
	GC_push_one(info.r4);
	GC_push_one(info.r5);

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

(gdb) break GC_push_gc_structures
.
.
.
(gdb) next
646         if (GC_push_other_roots != 0) (*GC_push_other_roots)();
(gdb)
651     }
(gdb)
GC_push_roots (all=556005, cold_gc_frame=0x4 <Address 0x4 out of  
bounds>) at mark_rts.c:646
646         if (GC_push_other_roots != 0) (*GC_push_other_roots)();
(gdb)
GC_default_push_other_roots () at os_dep.c:2065
2065    {
(gdb)
GC_default_push_other_roots () at os_dep.c:2067
2067    }
(gdb)
GC_default_push_other_roots () at os_dep.c:2066
2066        GC_push_all_stacks();
(gdb)
GC_push_all_stacks () at darwin_stop_world.c:72
72      void GC_push_all_stacks() {
(gdb)
0x0009a904 in __i686.get_pc_thunk.bx ()
(gdb)
Single stepping until exit from function __i686.get_pc_thunk.bx,
which has no line number information.
GC_push_all_stacks () at darwin_stop_world.c:85
85        mach_msg_type_number_t thread_state_count =  
MACHINE_THREAD_STATE_COUNT;
(gdb)
87        me = pthread_self();
(gdb)
88        if (!GC_thr_initialized) GC_thr_init();
(gdb)
91          for(p=GC_threads[i];p!=0;p=p->next) {
(gdb)
92            if(p -> flags & FINISHED) continue;
(gdb)
93            if(pthread_equal(p->id,me)) {
(gdb)
94              lo = GC_approx_sp();
(gdb)
152           if(p->flags & MAIN_THREAD)
(gdb)
155             hi = p->stack_end;
(gdb)
163           GC_push_all_stack(lo,hi);
(gdb)
91          for(p=GC_threads[i];p!=0;p=p->next) {
(gdb)
92            if(p -> flags & FINISHED) continue;
(gdb)
93            if(pthread_equal(p->id,me)) {
(gdb)
97              r = thread_get_state(
(gdb)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00000000 in ?? ()
(gdb)



More information about the Gc mailing list