Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7049774

UID construction appears to hang if time changed backwards

    Details

    • Subcomponent:
    • Resolved In Build:
      b23
    • CPU:
      generic
    • OS:
      generic

      Backports

        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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  coffeys Sean Coffey
                  Reporter:
                  shadowbug Shadow Bug
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: