java-1.4.2-p7 100% CPU usage (threading problem?)
freebsd at spatula.net
Tue Aug 9 07:37:41 GMT 2005
Environment is java-1.4.2_08-p7, built on FreeBSD 5.4-STABLE as of August
This is pretty easy to replicate, so I hope that helps. I don't think the
Resin/Apache integration is necessary to duplicate this problem, but I'm
including that information just for completeness. You can probably skip
everything to do with Apache and still see the problem.
Build Apache2 out of ports.
Download Resin 3.0.14 here:
tar xzvf resin-3.0.14.tar.gz
Configure with ./configure --with-java-home=/usr/local/jdk1.4.2
Make using "make" and then make install.
Set JAVA_HOME and RESIN_HOME in bin/http.sh. Also add
Stop/Start apache2, then start Resin using bin/httpd.sh with no
parameters. You should be able to load http://localhost/caucho-status and
see that Host localhost:6802 is up.
Now hit ^C or ^Z in the window where you started httpd.sh. Observe that
it doesn't exit, and that if your run top, you'll see java using all the
CPU it can, approaching 100%. It will not exit. It will not respond to
kill -3 or kill -6. A truss -p shows the process in an infinite loop
making the same kse_release call repeatedly. A ktrace also shows a RET
kse_release 0 following each kse_release call.
I did manage to get a stack trace with gcore; here's the stack trace:
#0 0x48097353 in pthread_testcancel () from /usr/lib/libpthread.so.1
#1 0x4808fc05 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
#2 0x48093be0 in pthread_setconcurrency () from /usr/lib/libpthread.so.1
#3 0x4808a405 in _nanosleep () from /usr/lib/libpthread.so.1
#4 0x4808a4fe in nanosleep () from /usr/lib/libpthread.so.1
#5 0x4808162b in select () from /usr/lib/libpthread.so.1
#6 0x48460e09 in os_sleep ()
#7 0x48460fcd in os::sleep ()
#8 0x484a9933 in WatcherThread::run ()
#9 0x4845f1d7 in _start ()
#10 0x48083b09 in pthread_create () from /usr/lib/libpthread.so.1
#11 0x4813f85b in _ctx_start () from /lib/libc.so.5
Looks like maybe this thread isn't shutting down cleanly? The stuck
thread seems to always be this one, though it's hard to be 100% certain.
"The aptly-named morons.org is an obscenity-laced screed..."
-- Robert P. Lockwood, Catholic League director of research
Nick Johnson, version 2.1 http://web.morons.org/
More information about the freebsd-java