This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: CNI threads and garbage collection on FC5
- From: "Boehm, Hans" <hans dot boehm at hp dot com>
- To: "Martin, Craig W" <Craig dot Martin2 at xerox dot com>, <java at gcc dot gnu dot org>
- Date: Thu, 11 May 2006 11:23:53 -0700
- Subject: RE: CNI threads and garbage collection on FC5
Given that you are starting all threads from compiled Java, I don't
understand this.
The check that generates the error message is somewhat new. I don't
recall exactly when it was added. But it checks for a condition that
was always very unsafe, though it may not have previously failed 100% of
the time.
The error message is generated when a thread starts a garbage
collection, stops the world, walks the thread table to trace from thread
stacks, and doesn't find itself in the thread table. Hence the thread
stack for the thread generating the abort call would be very
interesting. In particular, I would verify that it is indeed created
directly through Java, and not by some library behind your back. In
particular, GC_start_routine should be on the stack, very near the
bottom.
If there is still a GC bug hiding here, that stack trace would also be
interesting. It's conceivable that there is a race left in the thread
startup code, and that this is being triggered while a thread is
starting up or going away. In that case, it would be good to know
exactly where it is in GC_start_routine.
Hans
> -----Original Message-----
> From: java-owner@gcc.gnu.org [mailto:java-owner@gcc.gnu.org]
> On Behalf Of Martin, Craig W
> Sent: Thursday, May 11, 2006 10:58 AM
> To: java@gcc.gnu.org
> Cc: Martin, Craig W
> Subject: CNI threads and garbage collection on FC5
>
> All,
>
> First let me thank all of you for the wonderful work you do
> on GCC and all its derivatives. Awesome work!
>
> Recently I ran into a curious problem though, an application
> that uses CNI threads seems to fail with "collecting from
> unknown thread" and "null pointer exceptions" in Core 5.
> This application runs beautifully under Core 3 and 4, so
> something has changed under the Core 5 GCJ stuff that I
> can't pinpoint. I was unable to make my application run
> under core 5 without killing the GC and eventually went back
> to core 4. My problems are very similar to those discussed in:
>
> http://gcc.gnu.org/ml/java/2005-08/msg00147.html
>
> except that mine occur on Core 5 with GCJ 4.1.x. I should
> note also that all my threads are started from compiled Java
> classes as discussed in the aforementioned URL. I also noted
> that my CNI based shared libraries (originally two of them)
> had to be merged into one to get things to link (seemed
> strange to me). Don't know if this is related to the problem.
>
> Is there any possibility that something foundational has
> changed in GCJ that I am unaware of? I am concerned because
> as I port to more recent versions of Linux I fear my
> application will continue to fail until I understand what
> changed in GCJ 4.1 that caused these issues. Any pointers as
> to what I may be missing would be most welcome.
>
> Best regards,
>
> Craig Martin
>