United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7049774 UID construction appears to hang if time changed backwards
JDK-7049774 : UID construction appears to hang if time changed backwards

Details
Type:
Bug
Submit Date:
2011-05-30
Status:
Resolved
Updated Date:
2012-03-20
Project Name:
JDK
Resolved Date:
2011-06-27
Component:
core-libs
OS:
generic
Sub-Component:
java.rmi
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u24
Fixed Versions:
6u26-rev (b23)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
SHORT SUMMARY: BUG IN UID CODE CAUSING RMI SERVER TO HANG IF SYSTEM TIME IS 
CHANGED BACKWARD

INDICATORS:

Server RMI clock changed backwards, RMI server will hang with following stack 
trace : 

@ "RMI TCP Connection(4770)-127.0.0.1" daemon prio=10 tid=0x80ef4400 
nid=0x5a27
@ waiting for monitor entry [0xf57ff000]
@    java.lang.Thread.State: BLOCKED (on object monitor)
@                 at java.rmi.server.UID.<init>(UID.java:93)
@                 - waiting to lock <0x5d56c090> (a java.lang.Object)
@                 at
@ 
sun.rmi.transport.ConnectionOutputStream.<init>(ConnectionOutputStream.java:47

@ )
@                 at
@ 
sun.rmi.transport.StreamRemoteCall.getOutputStream(StreamRemoteCall.java:83)
@                 at
@ 
sun.rmi.transport.StreamRemoteCall.getResultStream(StreamRemoteCall.java:171)
@                 at
@ sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:312)
@                 at sun.rmi.transport.Transport$1.run(Transport.java:159)
@                 at java.security.AccessController.doPrivileged(Native 
Method)
@                 at
@ sun.rmi.transport.Transport.serviceCall(Transport.java:155)
@                 at
@ sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
@                 at
@ 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:79

@ 0)
@                 at
@ 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649

@ )
@                 at
@ 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java

@ :886)
@                 at
@ 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908

@ )
@                at java.lang.Thread.run(Thread.java:662)
@ .


COUNTER INDICATORS:
TRIGGERS:

System clock changed back on an RMI server and 65536 UID
constructor calls made. 

KNOWN WORKAROUND:

Don't modify system clock while RMI server is running.

PRESENT SINCE:

Looks to be present since at least 1.4.2 + later JDK code.
HOW TO VERIFY:

Testcase available - (to upload/attach later)

NOTES FOR SE:

Reported on 6u24.
We should add an extra condition so that the lastCount static variable 
counter is checked against the current millisecond time value (i.e 65536
unique constructor calls allowed per millisecond) 

REGRESSION:

N/A

                                    

Comments
EVALUATION

same port as jdk 8 fix. We no longer have to wait if system clock is gone back.
                                     
2011-06-20



Hardware and Software, Engineered to Work Together