JVM Appears to Hang When Using Timer Methods on Linux (Doc ID 1616828.1)

Last updated on JANUARY 26, 2014

Applies to:

Java SE JDK and JRE - Version 1.6.0 and later
Linux x86
Linux x86-64

Symptoms

On Java SE 6 and Java SE 7 and Oracle Enterprise Linux (OEL) 6 (Kernel versions 2.6.32-279.el6.x86_64 and 2.6.32-358.el6.x86_64):

ACTUAL BEHAVIOR
---------------------

The JDK seems to hang when using timer methods over a system clock change.  This does not occur on OEL 5.

EXPECTED BEHAVIOR
-----------------------
It is expected that timer methods will work across system clock changes.

STEPS
-----------------------
The issue can be reproduced at will with the following steps:

1. Disable ntpd
2. Compile and run the Test program from Bug JDK-6311057
3. Hit a key in order to sleep for 15 seconds.
4. Quickly change date to a time in the past, say, 2 hours.
5. Notice the behavior:

The program should print 'woke up' and exit after 15 seconds have elapsed.  Instead, the following are the results of our testing:

Test cases (most were executed many times):
java 1.6.0_24-b07 on virtual oel5 passes this test and returns in 15s.
java 1.6.0_35-b10 on virtual oel5 passes this test and returns in 15s.
java 1.6.0_35-b10 on virtual 2.6.32-279.el6.x86_64 fails and sleeps forever, seemingly.
java 1.6.0_45-b06 on virtual 2.6.32-279.el6.x86_64 fails and sleeps ~2m. This time seems to vary.
java 1.6.0_51-b11 on virtual 2.6.32-279.el6.x86_64 fails and sleeps ~2m. This time seems to vary.
java 1.6.0_35-b10 on physical 2.6.32-358.el6.x86_64 fails and sleeps ~2m. This time may vary.
java 1.6.0_51-b11 on virtual 2.6.32-358.el6.x86_64 fails and sleeps ~2m. This time seems to vary.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms