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

Monitor::wait takes signed integer as timeout

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      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

              Assignee:
              Unassigned Unassigned
              Reporter:
              ayang Albert Yang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: