This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug libgcj/13212] JNI/CNI AttachCurrentThread does not register thread with garbage collector


On Sat, 25 Mar 2006, Richard Guenther wrote:

> On Sat, 25 Mar 2006, Richard Guenther wrote:
> 
> > On Fri, 24 Mar 2006, aph at gcc dot gnu dot org wrote:
> > > ------- Comment #28 from aph at gcc dot gnu dot org  2006-03-24 17:41 -------
> > > Richard Guenther: should this be posted to java@gcc.gnu.org for discussion?
> > > 
> > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13212
> > 
> > Hmm, I guess so.  Me and Michael Matz have tried to somehow work around
> > the gjc GC issues with OpenOffice which does open libgcj via dlopen and
> > such suffers from the thread registration problem.  On the 4.1 branch
> > there is the workaround to have libgcj provide pthread_create which should
> > in theory override libpthread.so pthread_create.  This works only if
> > you link against libgcj, not if you later dlopen it, because you then
> > bound to say pthread_create@GLIBC_2.1.  To work around this issue we made
> > libgcj provide pthread_create with the same symver as glibc does.  This
> > exposes another issue, namely boehm GC being configured with
> > GC_all_interior_pointers set to 1 by default - which causes GC_bl_init
> > to not initialize GC_old_normal_bl and others.  libgcj unfortunately
> > sets GC_all_interior_pointers to 0 at init time, which then causes the
> > uninitialized GC_old_normal_bl to be used and we segfault.  To work around
> > this we changed boehm to default to GC_all_interior_pointers 0 instead.
> > 
> > Now, while this seems to solve the OpenOffice problems if you LD_PRELOAD
> > libgcj, the change seems to cause libjava testsuite failures (which we
> > didn't yet investigate):
> 
> Michael just noticed I messed up during cleaning up the patch:

And another one - rather than

AC_DEFINE(ALL_INTERIOR_POINTERS,0,[allows all pointers to the interior of 
objects to be recognized])

in boehm-gc/configure.ac you need

dnl AC_DEFINE(ALL_INTERIOR_POINTERS,1,[allows all pointers to the interior 
of objects to be recognized])

because boehm-gc later checks using #ifdef.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]