JDK-6314875 : Linux NPTL/Futex pthread_cond_timedwait() bug can corrupt condvar & hang - impacts JVM object.wait()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6,7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic,x86
  • Submitted: 2005-08-23
  • Updated: 2015-07-08
  • Resolved: 2005-10-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b54Fixed
Related Reports
Duplicate :  
Relates :  
Description
Some versions of NPTL embody a flaw where pthread_cond_timedwait() can 
hang indefinitely.  For instance NPTL 0.60 on 2.4.21-4ELsmp is vulnerable.  
For specifics regarding the bug see GLIBC BUGID 261237 :
   http://www.mail-archive.com/###@###.###/msg10837.html.

Briefly, pthread_cond_timedwait() calls with an expiry time that's not in the future
will either hang or corrupt the condvar, resulting in subsequent hangs if the condvar
is used.  (The simple C test-case provided in the GLIBC bug report manifests the
hang).  The JVM is vulernable via sleep(), Object.wait(timo), LockSupport.parkNanos()
and monitorenter.  All those operations may result in calls to pthread_cond_timedwait().  

Workarounds:
- Upgrade to a version of linux/nptl that does not have the bug
- Use LD_ASSUME_KERNEL to select the older non-ntpl libpthread.so

Comments
EVALUATION see comments
03-10-2005

SUGGESTED FIX see comments
23-08-2005

WORK AROUND see description
23-08-2005