java/7095: GCJ built multithreaded program keeps creating zombies

aeby@graeff.com aeby@graeff.com
Fri Jun 21 05:56:00 GMT 2002


>Number:         7095
>Category:       java
>Synopsis:       GCJ built multithreaded program keeps creating zombies
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 21 05:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Aeby
>Release:        unknown-1.0
>Organization:
>Environment:
RedHat 7.2, Linux 2.4.7, glibc 2.2.4+linuxthreads, 
GCC 3.1 (POSIX threads enabled)
>Description:
I'm trying to use GCJ in order to compile some Java classes
into native binaries. While this works great there is still
one problem left I have not been able to solve: A program
creating (many) sub-threads will leave this sub-threads as
zombie processes when they die. This is reproducible using
a very small sample program (as attached here). 

The problem does not necessarily occur immediately after
starting the binary, sometimes a program may run as expected
for a few hours, then starts creating zombies (and from that
time on each terminating thread will end up as a zombie, as
far as I can see), sometimes the "zombie creation" starts
immediately. The program still works, thus the running
threads are not affected (well, at least until the process
table overflows).

Since I am not sure if this is really a bug (why would
nobody else have reported it, then?) or just some
misconfiguration in my runtime environment I declared this
request be a support request. 
>How-To-Repeat:
Compile the attached sample code with

  gcj -o test --main=test test.java

and run the so-created binary until you get a number of
zombies (this might take a few hours!)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.java"

cHVibGljIGNsYXNzIHRlc3QgewogICAgCiAgICBwcml2YXRlIGNsYXNzIG15dGhyZWFkIGV4dGVu
ZHMgVGhyZWFkIHsKICAgICAgICBwdWJsaWMgbXl0aHJlYWQoKSB7CgkgICAgU3lzdGVtLm91dC5w
cmludGxuKCAic3RhcnRpbmcgIiArIGdldE5hbWUoKSApOwoJfQoKCXByb3RlY3RlZCB2b2lkIGZp
bmFsaXplKCkgewoJICAgIFN5c3RlbS5vdXQucHJpbnRsbiggImZpbmFsaXppbmcgIiArIGdldE5h
bWUoKSApOwoJfQoKCXB1YmxpYyB2b2lkIHJ1bigpIHsKCSAgICBTeXN0ZW0ub3V0LnByaW50bG4o
ICJqdXN0IGRvaW5nIHNvbWV0aGluZyIgKTsKCX0KICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZv
aWQgbWFpbiggU3RyaW5nIGFyZ3NbXSApIHsKCXdoaWxlKCB0cnVlICkgewoJICAgIFRocmVhZCB0
MSA9IG5ldyBteXRocmVhZCgpOwoJICAgIFRocmVhZCB0MiA9IG5ldyBteXRocmVhZCgpOwoJICAg
IHQxLnN0YXJ0KCk7CgkgICAgdDIuc3RhcnQoKTsKCSAgICB0cnkgewoJICAgICAgICBUaHJlYWQu
c2xlZXAoIDIwMDAgKTsKCSAgICB9CgkgICAgY2F0Y2goIEV4Y2VwdGlvbiBlICkge30KCSAgICB0
cnkgewoJICAgICAgICB0MS5qb2luKCk7CgkgICAgfQoJICAgIGNhdGNoKCBFeGNlcHRpb24gZSAp
IHsgU3lzdGVtLm91dC5wcmludGxuKCBlICk7fQoJICAgIHRyeSB7CgkgICAgICAgIHQyLmpvaW4o
KTsKCSAgICB9CgkgICAgY2F0Y2goIEV4Y2VwdGlvbiBlICkgeyBTeXN0ZW0ub3V0LnByaW50bG4o
IGUgKTt9CgkgICAgUnVudGltZS5nZXRSdW50aW1lKCkuZ2MoKTsKCX0KICAgIH0KfTsK



More information about the Java-prs mailing list