-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8346383: Cannot use DllMain in libdt_socket for static builds #22789
Conversation
👋 Welcome back ihse! A progress list of the required criteria for merging this PR into |
I'm not sure what tests to run for this change, apart from tier1. I am open to suggestions. |
@magicus 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:
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 229 new commits pushed to the
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 |
Webrevs
|
Can I get any reviewers for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good but needs copyright year updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly when will WSACleanup
get called via the atexit handler versus when it gets called today? I suspect it is sooner than when DllMain
with DLL_PROCESS_DETACH
would be called. In which case do we now risk tearing down socket support whilst it may still be in use?
My understanding is that it is later. But I am also not sure if this is well-specified or just an implementation detail. I'd say our code is broken if we rely on anything working between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will click approve but I think we need to keep a careful eye out for odd network related failures during shutdown.
Thanks
/integrate |
Going to push as commit d3a7ac2.
Your commit was automatically rebased without conflicts. |
To be able to properly support static builds on Windows in JDK-8346377, we cannot use
DllMain
, for two reasons:DllMain
definitions throughout the JDK native libraries, causing name collisions.While it could have been possible to keep the
DllMain
function for non-static builds and just use an alternative solution for static builds, I think it is preferable to have a single solution that works as well for both static and dynamic builds.On top of this, the existing solution was contrary to Microsoft recommendations, which state: "The WSACleanup function typically leads to protocol-specific helper DLLs being unloaded. As a result, the WSACleanup function should not be called from the DllMain function in a application DLL. This can potentially cause deadlocks. "
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22789/head:pull/22789
$ git checkout pull/22789
Update a local copy of the PR:
$ git checkout pull/22789
$ git pull https://git.openjdk.org/jdk.git pull/22789/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22789
View PR using the GUI difftool:
$ git pr show -t 22789
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22789.diff
Using Webrev
Link to Webrev Comment