GCJ built multithreaded program keeps creating zombies

Wolfgang Bangerth bangerth@ticam.utexas.edu
Wed Dec 18 15:23:00 GMT 2002


> This is most likely a problem with glibc or the kernel.
> Offhand I don't see how libgcj could cause this problem.
> We pretty much leave low-level thread stuff up to the
> underlying platform.

It can be called a feature: On Linux threads are created basically by
calling fork/clone. When a process (and thus, here, also a thread) ends,
it remains a zombie until its return valued is reaped by a waitpid call,
which should also be what pthread_join does. So unless a thread is joined, 
it will remain a zombie.

I don't have gcj installed locally, so have no way to find out what 
Thread::join actually does, and whether it is called in your program (or 
if an exception intercepts it), but I bet that is where the problem is.

Regards
  Wolfgang

PS: And yes, I've tripped over this problem before as well ;-)

-------------------------------------------------------------------------
Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth




More information about the Gcc-bugs mailing list