My Oracle Support Banner

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

Last updated on MARCH 31, 2023

Applies to:

Java SE JDK and JRE - Version 6 to 7 [Release 6 to 7]
Linux x86
Linux x86-64

Symptoms

With 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),  the JDK seems to hang when using timer methods over a system clock change.  This does not occur on OEL 5.

However, it is expected that timer methods will work across system clock changes.

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 testing:

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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.