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

Monitor::wait takes signed integer as timeout

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 21
    • 16
    • hotspot
    • b05

    Description

      In `mutex.cpp`, `Monitor::wait(int64_t timeout, ...)` takes a signed integer as timeout, and asserts it must be positive , `assert(timeout >= 0, "negative timeout");`. Changing it to `uint64_t` could forbid invalid values.

      A contrived example to trigger the assertion above using the `fastdebug` build: `java -XX:+UseZGC -Xms1g -XX:SoftMaxHeapSize=2g -Xmx4g -XX:ZUncommitDelay=9223372036854775 --version`.

      Attachments

        Issue Links

          Activity

            People

              dholmes David Holmes
              ayang Albert Yang
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: