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()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 6, 7
    • Fix Version/s: 6
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b54
    • CPU:
      generic, x86
    • OS:
      linux

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: