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

(fs) WindowsPath::getPathForWin32Calls synchronizes on String object

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8, 11, 15, 16
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b21
    • OS:
      windows

      Description

      sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on 'path' field, which is a String object:

              if (type != WindowsPathType.DRIVE_RELATIVE) {
                  synchronized (path) {
                      pathForWin32Calls = new WeakReference<String>(resolved);
                  }
              }

      this might lead to a deadlock, this code should synchronize on "this".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iignatyev Igor Ignatyev (Inactive)
              Reporter:
              iignatyev Igor Ignatyev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: