Name: moC74494 Date: 05/27/98
We have found a problem with rmiregistry under native threads on
Solaris, JDK version JDK1.2beta4_G.
The VM running the rmiregistry consumes 100% CPU and seems to be
unresponsive to clients. This behavior does not reproduce with
green threads.
Here is a diagnosis and (possible) fix:
In sun/rmi/registry/RegistryImpl.java near line 264,
Thread.sleep() is called with the argument Long.MAX_VALUE.
Under the native thread implementation, the current time in millis is
added to the argument before calling cond_wait.
From condvar_md.c:
(dbx) list condvarTimedWait
122 {
123 sigjmp_buf jmpbuf;
124 int err;
125 timestruc_t timeout;
126 sys_thread_t *self;
127 int64_t end_time = sysTimeMillis() + millis;
128
The resulting value overflows and an invalid timestruc_t is
constructed and passed in into cond_timedwait(), which returns
with an error code of 22 (EINVAL). This is masked and silently
ignored by upper layers of the system and no exception is reported
to the user.
Thus, instead of sleeping for ever, the thread ends up running hot.
(Review ID: 32479)
======================================================================