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

Linux NPTL/Futex pthread_cond_timedwait() bug can corrupt condvar & hang - impacts JVM object.wait()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6, 7
    • hotspot
    • b54
    • generic, x86
    • linux

      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

            dice Dave Dice
            dice Dave Dice
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: