Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8255074: sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on String object #774

Closed
wants to merge 2 commits into from

Conversation

iignatev
Copy link
Member

@iignatev iignatev commented Oct 20, 2020

Hi all,

could you please review this small and trivial patch?

from JBS:
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, synchronizing on this is appropriate here.

testing:

  • tier1
  • test/jdk/java/nio on windows-x64

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x32 Linux x64 Windows x64 macOS x64
Build ✔️ (1/1 passed) ❌ (2/5 failed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ❌ (1/9 failed) ✔️ (9/9 passed)

Failed test tasks

Issue

  • JDK-8255074: sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on String object

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/774/head:pull/774
$ git checkout pull/774

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 20, 2020

👋 Welcome back iignatyev! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 20, 2020

@iignatev The following label will be automatically applied to this pull request:

  • nio

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the nio nio-dev@openjdk.org label Oct 20, 2020
@iignatev iignatev marked this pull request as ready for review October 20, 2020 22:49
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 20, 2020
@mlbridge
Copy link

mlbridge bot commented Oct 20, 2020

Webrevs

@openjdk
Copy link

openjdk bot commented Oct 21, 2020

@iignatev This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8255074: sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on String object

Reviewed-by: bpb

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 27 new commits pushed to the master branch:

  • 9e9f5e6: 8017179: [macosx] list1 and list2 vistble item isn't desired
  • 2ee2b4a: 8231454: File lock in Windows on a loaded jar due to a leak in Introspector::getBeanInfo
  • 42a6ead: 8254884: Make sure jvm does not crash with Arm SVE and Vector API
  • e5870cf: 8252133: The java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java fails if metal pipeline is active
  • afc967f: 8254783: jpackage fails on Windows when application name differs from installer name
  • 3ccf487: 8253019: Enhanced JPEG decoding
  • cfb02d4: 8250861: Crash in MinINode::Ideal(PhaseGVN*, bool)
  • 0d35235: 8249927: Specify limits of jdk.serialProxyInterfaceLimit
  • d6cef99: 8245417: Improve certificate chain handling
  • 24f7f84: 8245412: Better class definitions
  • ... and 17 more: https://git.openjdk.java.net/jdk/compare/acacae5e0c58dc711de16edcef0022fe162c1ad9...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 21, 2020
@iignatev
Copy link
Member Author

Thanks, Brian.

/integrate

@openjdk openjdk bot closed this Oct 21, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 21, 2020
@openjdk
Copy link

openjdk bot commented Oct 21, 2020

@iignatev Since your change was applied there have been 27 commits pushed to the master branch:

  • 9e9f5e6: 8017179: [macosx] list1 and list2 vistble item isn't desired
  • 2ee2b4a: 8231454: File lock in Windows on a loaded jar due to a leak in Introspector::getBeanInfo
  • 42a6ead: 8254884: Make sure jvm does not crash with Arm SVE and Vector API
  • e5870cf: 8252133: The java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java fails if metal pipeline is active
  • afc967f: 8254783: jpackage fails on Windows when application name differs from installer name
  • 3ccf487: 8253019: Enhanced JPEG decoding
  • cfb02d4: 8250861: Crash in MinINode::Ideal(PhaseGVN*, bool)
  • 0d35235: 8249927: Specify limits of jdk.serialProxyInterfaceLimit
  • d6cef99: 8245417: Improve certificate chain handling
  • 24f7f84: 8245412: Better class definitions
  • ... and 17 more: https://git.openjdk.java.net/jdk/compare/acacae5e0c58dc711de16edcef0022fe162c1ad9...master

Your commit was automatically rebased without conflicts.

Pushed as commit 6bd05b1.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a typo in the original code.

Let's fix the description in the JBS before pushing this.

@@ -206,7 +206,7 @@ String getPathForWin32Calls() throws WindowsException {
// directory on removal media devices can change during the lifetime
// of the VM)
if (type != WindowsPathType.DRIVE_RELATIVE) {
synchronized (path) {
synchronized (this) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I cannot see why this synchronized block exists at all...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not strictly needed and could be removed.

@iignatev
Copy link
Member Author

Let's fix the description in the JBS before pushing this.

@AlanBateman , sorry it was already integrated w/ the original commit message before you commented.

@iignatev iignatev deleted the 8255074 branch October 21, 2020 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated nio nio-dev@openjdk.org
4 participants