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

8287917: System.loadLibrary does not work on Big Sur if JDK is built with macOS SDK 10.15 and earlier #1298

Closed
wants to merge 1 commit into from

Conversation

jmtd
Copy link

@jmtd jmtd commented Aug 2, 2022

This pull request contains a backport of commit fe807217 from the openjdk/jdk repository.

The commit being backported was authored by Yoshiki Sato on 15 Jun 2022 and was reviewed by Mandy Chung.

I wish to backport it for Oracle parity.

It does not apply cleanly due to a renamed file in jdk master subsequent to 11u:

src/java.base/macosx/classes/{java/lang => jdk/internal/loader}/ClassLoaderHelper.java

Manual testing results forthcoming; I'll add them as a comment on this PR.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8287917: System.loadLibrary does not work on Big Sur if JDK is built with macOS SDK 10.15 and earlier

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev pull/1298/head:pull/1298
$ git checkout pull/1298

Update a local copy of the PR:
$ git checkout pull/1298
$ git pull https://git.openjdk.org/jdk11u-dev pull/1298/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1298

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/1298.diff

…with macOS SDK 10.15 and earlier

Reviewed-by: mchung
@bridgekeeper
Copy link

bridgekeeper bot commented Aug 2, 2022

👋 Welcome back jdowland! 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 changed the title Backport fe807217a79753f84c00432e7451c17baa6645c5 8287917: System.loadLibrary does not work on Big Sur if JDK is built with macOS SDK 10.15 and earlier Aug 2, 2022
@openjdk
Copy link

openjdk bot commented Aug 2, 2022

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label Aug 2, 2022
@jmtd
Copy link
Author

jmtd commented Aug 2, 2022

Test passes after manually building the native component (as with the 17u backport):

 $  pushd test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache
 $  cc  exeLibraryCache.c -o LibraryCache
 $  popd
 $  $JT_HOME/bin/jtreg -jdk:build/macosx-x86_64-server-release/images/jdk  \
 -nativepath:test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache  \
test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/LibraryFromCache.java

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 2, 2022
@mlbridge
Copy link

mlbridge bot commented Aug 2, 2022

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 30, 2022

@jmtd This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@jmtd
Copy link
Author

jmtd commented Aug 31, 2022

Ping comment

This requires a review. It has been some time since I did it, so I'll check it's still clean Tomorrow.

@RealCLanger
Copy link
Contributor

Hi @jmtd, sorry, we kind of overlooked this obviously. As Oracle has backported this to 11.0.17, would you mind rebasing this PR to jdk11u? I can then review, test & approve it. Thanks!

@jmtd
Copy link
Author

jmtd commented Sep 2, 2022

Hi @jmtd, sorry, we kind of overlooked this obviously. As Oracle has backported this to 11.0.17, would you mind rebasing this PR to jdk11u? I can then review, test & approve it. Thanks!

Sure, I'm happy to do that. It will mean opening a new PR since it's a different GitHub repository. That's not a problem.

Before I do that I must first resolve a testing issue locally. The test is being skipped on my machine due to "Test skipped. Library BLAS not found"; with both jdk11u and jdk11u-dev, pre and post this patch. I'll figure that out first.

@jmtd
Copy link
Author

jmtd commented Sep 7, 2022

@RealCLanger, the patch (after resolving the original conflict, i.e., the commit as in the PR today) applies clean to jdk11u and the test passes.

For belt and braces, I really wanted to try and verify things by proving the test fail prior to applying the patch; unfortunately, my macOS development machine has updated itself since I did the backport:

I initially had macOS Big Sur and SDK version 10.14; at the time I did the backport with these versions I could see the test fail.

I now have SDK version MacOSX11.3.sdk. With this, the native component (exeLibraryCache.c) successfully loads the library libblas.dylib before and after the patch. I've attempted to install an older SDK but I don't know enough yet about how this works, because what I've tried (SDKROOT=/path/to/old/sdk cc ...) the resultant binary is bit-for-bit identical.

To tackle this situation for future macOS work I'm going to investigate setting up some VMs of specific macOS and XCode versions.

Side-note: The test harness runs twice, once to try and load libblas.dylib and another time to load libBLAS.dylib. The second attempt never succeeds for me in any configuration, but the consequence is a test skip, rather than a failure. I might follow this up in jdk/master (same story there)

I leave it up to you whether we should push this now or keep investigating.

Thanks

@RealCLanger
Copy link
Contributor

@jmtd ok. I also don't have an easy possiblity to test on such old OS and SDK releases. I suggest, since this only affects rather old scenarios, we just take this PR into jdk11u-dev for the January update. It's not worth transferring it to jdk11u now and maybe risking something during rampdown.

I'll see if I can review it here.

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

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

LGTM. Please flag for approval.

@openjdk
Copy link

openjdk bot commented Sep 7, 2022

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

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

8287917: System.loadLibrary does not work on Big Sur if JDK is built with macOS SDK 10.15 and earlier

Reviewed-by: clanger

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

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 Sep 7, 2022
@jmtd
Copy link
Author

jmtd commented Sep 7, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Sep 7, 2022

Going to push as commit 9767c4c.
Since your change was applied there have been 217 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 7, 2022
@openjdk openjdk bot closed this Sep 7, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 7, 2022
@openjdk
Copy link

openjdk bot commented Sep 7, 2022

@jmtd Pushed as commit 9767c4c.

💡 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
backport integrated Pull request has been integrated
2 participants