[Gc] Re: GC 6.4 vs Irix w/ threads

Dan Bonachea bonachea at cs.berkeley.edu
Tue Apr 12 00:49:15 PDT 2005


At 04:39 AM 4/11/2005, you wrote:
>GC6.4 apparently no longer worked on Irix with threads.  Apparently
>a bug in aix_irix_threads.c was no longer hidden by a very lenient
>pthread_attr_getdetachstate.
>
>The following patch should solve the problem.

Hi Hans - Thanks for the patch.

32-bit gctest seems to be working now, although I'm still seeing some bus 
errors using the IRIX GC in Titanium applications on MPI-based backends, so I 
believe there are some other IRIX-GC issues remaining - I suspect the problem 
is the shared libraries which MPI loads (eg /usr/lib32/libmpi.so), but I don't 
have proof of that yet. Do you have any small GC correctness tests that test 
the use of MPI and/or shared libraries that allocate non-trivial memory?

In any case, 64-bit GC still seems to be completely broken on lou, both with 
and without pthreads. If you try configuring 6.4, including your patch below 
with:
   setenv CC "/usr/bin/cc -64"
then gctest should give you a bus error in GC_find_limit :

#0  0x000000001001559c in GC_find_limit (p=0xfffffffab50 "", up=1) at 
os_dep.c:811
#1  0x000000001001561c in GC_get_stack_base () at os_dep.c:1038
#2  0x000000001000fdfc in GC_init_inner () at misc.c:676
#3  0x000000001001d9c4 in GC_generic_malloc_inner (lb=7, k=1) at malloc.c:123
#4  0x000000001001dc4c in GC_generic_malloc (lb=7, k=1) at malloc.c:192
#5  0x000000001001dfa8 in GC_malloc (lb=7) at malloc.c:297
#6  0x000000001000af44 in run_one_test () at test.c:1218
#7  0x000000001000bdac in main () at test.c:1517

This is the signal handler problem I originally reported that apparently still 
remains. It's also possible this signal issue is the same problem MPI is 
having - perhaps it registers some SIGBUS handlers for its own uses (eg 
parallel job shutdown) that interfere with the GC_find_limit scan. I think 
perhaps we need a more robust way to find the stack base on IRIX...

Dan

PS - lou lacks gdb, but I have it installed here:
~bonachea/bin/gnu/bin/gdb
(note you'll need to link the static libgc.a to use gdb)

>Hans
>
>--- aix_irix_threads.c.orig     Sat Apr  9 20:37:22 2005
>+++ aix_irix_threads.c  Sat Apr  9 20:38:17 2005
>@@ -580,7 +580,11 @@
>      si -> start_routine = start_routine;
>      si -> arg = arg;
>
>-    pthread_attr_getdetachstate(attr, &detachstate);
>+    if (NULL == attr) {
>+       detachstate = PTHREAD_CREATE_JOINABLE;
>+    } else {
>+        pthread_attr_getdetachstate(attr, &detachstate);
>+    }
>      if (PTHREAD_CREATE_DETACHED == detachstate) my_flags |= DETACHED;
>      si -> flags = my_flags;
>      result = pthread_create(new_thread, attr, GC_start_routine, si);



More information about the Gc mailing list