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

8267564: JDK-8252971 causes SPECjbb2015 socket exceptions on Windows when MKS is installed #4339

Closed

Conversation

Michael-Mc-Mahon
Copy link
Member

@Michael-Mc-Mahon Michael-Mc-Mahon commented Jun 3, 2021

Hi,

This fixes a problem where unix domain sockets are available on Windows from third party winsock drivers (other than the Microsoft implementation in Windows 10/2019). These are available (unexpectedly) on earlier Windows releases and are not supported by Java.

The fix is to search for the expected winsock service provider ID and specifically use that one when creating sockets. Previously, we just attempted to create a unix domain socket, and once that succeeded we assumed we had the right service provider.

I haven't included a regression test because the environment to reproduce the issue is not part of the standard test configuration. Also, the new code is well exercised by existing tests.

Thanks,
Michael.


Progress

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

Issue

  • JDK-8267564: JDK-8252971 causes SPECjbb2015 socket exceptions on Windows when MKS is installed

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4339/head:pull/4339
$ git checkout pull/4339

Update a local copy of the PR:
$ git checkout pull/4339
$ git pull https://git.openjdk.java.net/jdk pull/4339/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4339

View PR using the GUI difftool:
$ git pr show -t 4339

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4339.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 3, 2021

👋 Welcome back michaelm! 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 openjdk bot added the rfr Pull request is ready for review label Jun 3, 2021
@openjdk
Copy link

openjdk bot commented Jun 3, 2021

@Michael-Mc-Mahon 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 Jun 3, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 3, 2021

Webrevs

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.

I don't object to select the MS provider but it strikes me that we are working around a bug in MKS. I wonder if there is a newer MKS version that fixes this, I also wonder if sockets created with their LSP can be multiplexed with other sockets from other providers.

@AlanBateman
Copy link
Contributor

The latest version looks much better. One niggle is that the method to test if Unix domain sockets is supported has a side effect of setting provider. What you would think about renaming to "init" or something better. It can continue to return a boolean to indicate if supported or not.

I should have been clearer in my comment about cmpGuid. I meant that memcmp returns -1, 0 or 1 and it would have been clearer if have it return JNI_FALSE if it returned something != 0 (it was the !memcpy that was awkward). What you have now is okay.

@Michael-Mc-Mahon
Copy link
Member Author

The latest version looks much better. One niggle is that the method to test if Unix domain sockets is supported has a side effect of setting provider. What you would think about renaming to "init" or something better. It can continue to return a boolean to indicate if supported or not.

I should have been clearer in my comment about cmpGuid. I meant that memcmp returns -1, 0 or 1 and it would have been clearer if have it return JNI_FALSE if it returned something != 0 (it was the !memcpy that was awkward). What you have now is okay.

That's fine. I think init() is a good name. I'll make that change now. Thanks for the review!

  • Michael

@openjdk
Copy link

openjdk bot commented Jun 5, 2021

@Michael-Mc-Mahon 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:

8267564: JDK-8252971 causes SPECjbb2015 socket exceptions on Windows when MKS is installed

Reviewed-by: alanb

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 33 new commits pushed to the master branch:

  • 7e41ca3: 8266957: SA has not followed JDK-8220587 and JDK-8224965
  • 6ff978a: 8267204: Expose access to underlying streams in Reporter
  • 76b54a1: 8263512: [macos_aarch64] issues with calling va_args functions from invoke_native
  • 4e6748c: 8267687: ModXNode::Ideal optimization is better than Parse::do_irem
  • 48dc72b: 8268272: Remove JDK-8264874 changes because Graal was removed.
  • 20b6312: 8268151: Vector API toShuffle optimization
  • 64ec8b3: 8212155: Race condition when posting dynamic_code_generated event leads to JVM crash
  • cd0678f: 8199318: add idempotent copy operation for Map.Entry
  • b27599b: 8268222: javax/xml/jaxp/unittest/transform/Bug6216226Test.java failed, cannot delete file
  • 59a539f: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries
  • ... and 23 more: https://git.openjdk.java.net/jdk/compare/c8f4c02bf005ee1531193535632a5ece768916d0...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 Jun 5, 2021
@Michael-Mc-Mahon
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Jun 8, 2021
@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 Jun 8, 2021
@openjdk
Copy link

openjdk bot commented Jun 8, 2021

@Michael-Mc-Mahon Since your change was applied there have been 78 commits pushed to the master branch:

  • 00c88f7: 8266918: merge_stack in check_code.c add NULL check
  • 8105478: 8268165: AsyncLogging will crash if rotate() fails
  • fd91b2a: 8265440: IGV: make node selection more visible
  • 81bad59: 8257774: G1: Trigger collect when free region count drops below threshold to prevent evacuation failures
  • 341f676: 8267908: linux: thread_native_entry can scribble on stack frame
  • f40c89e: 8267209: Child threads should defer logging to after child-parent handshake
  • ae986bc: 8266749: AArch64: Backtracing broken on PAC enabled systems
  • 36c4e5f: 8267187: Remove deprecated constructor for Log
  • fc08af5: 8174222: LambdaMetafactory: validate inputs and improve documentation
  • 5e557d8: 8266967: debug.cpp utility find() should print Java Object fields.
  • ... and 68 more: https://git.openjdk.java.net/jdk/compare/c8f4c02bf005ee1531193535632a5ece768916d0...master

Your commit was automatically rebased without conflicts.

Pushed as commit 61ab4b9.

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

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
2 participants