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

[windows] os::getTimesSecs() returns negative values for kernel, user times

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b112
    • OS:
      windows

      Description

      os::getTimesSecs() has a bug which causes it to return negative values for kernel and user times for a process because the code misunderstands the return values of GetProcessTimes().

      Even though both values are of type FILETIME, the returned values are in number of 100ns units since process start, not since 1601, and therefore the normal windows-to-java-time-translation cannot be used.

      This does not cause any bugs yet because os::getTimesSecs() is only used within the TraceCPUTime class, which takes two measurements and uses the delta.

        Attachments

          Activity

            People

            Assignee:
            stuefe Thomas Stuefe
            Reporter:
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: