Skip to content

8344821: Test CheckDefaultArchiveFile.java fails if classes_coh.jsa is not present #22374

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

Conversation

calvinccheung
Copy link
Member

@calvinccheung calvinccheung commented Nov 25, 2024

JDK image built by Oracle does not include the CDS archives for compact object headers. This fix throws a SkippedException if UseCompactObjectHeaders is enabled and the default CDS archive for COH is not present.

Update:
Instead of fixing the test, we've decided to just removing it.


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-8344821: Test CheckDefaultArchiveFile.java fails if classes_coh.jsa is not present (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22374/head:pull/22374
$ git checkout pull/22374

Update a local copy of the PR:
$ git checkout pull/22374
$ git pull https://git.openjdk.org/jdk.git pull/22374/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22374

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22374.diff

Using Webrev

Link to Webrev Comment

@calvinccheung calvinccheung marked this pull request as ready for review November 25, 2024 23:46
@bridgekeeper
Copy link

bridgekeeper bot commented Nov 25, 2024

👋 Welcome back ccheung! 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 Nov 25, 2024

@calvinccheung 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:

8344821: Test CheckDefaultArchiveFile.java fails if classes_coh.jsa is not present

Reviewed-by: iklam, dholmes

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

  • c329f97: 8345015: Remove unused method lookup_time_t_function
  • 86d527f: 8344949: javax.security.auth.Subject.SecureSet.writeObject does not do a security check anymore
  • f0b72f7: 8342380: Implement JEP 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe
  • fc2da15: 8344419: Use StaticProperty in some JDK classes
  • 3e509c8: 8344773: SM cleanup in ForkJoinPool
  • 6da3ecd: 8344960: RISC-V: fix TestFloatConversionsVectorNaN for COH and AlignVector
  • 9291abc: 8342074: Fix runtime/Thread/TestAlwaysPreTouchStacks.java to be flagless or accept VM flags
  • 0054bbe: 8343756: CAN_SHOW_REGISTERS_ON_ASSERT for Windows
  • 3a625f3: 8344628: Test TestEnableJVMCIProduct.java run with virtual thread intermittent fails
  • 25dd51e: 8344222: Remove calls to SecurityManager and doPrivileged in java.net.HttpURLConnection, java.net.HttpConnectSocketImpl, and javax.net.HttpsURLConnection after JEP 486 integration
  • ... and 165 more: https://git.openjdk.org/jdk/compare/9e92a9e2bab04b79626b88a7dd017dd0def04d7a...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 rfr Pull request is ready for review label Nov 25, 2024
@openjdk
Copy link

openjdk bot commented Nov 25, 2024

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

  • hotspot-runtime

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 hotspot-runtime hotspot-runtime-dev@openjdk.org label Nov 25, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 25, 2024

Webrevs

@dholmes-ora
Copy link
Member

I think I agree with what @iklam said in JBS - this test seems to have no purpose now. I can't tell what exactly it is trying to check for. Depending on the runtime flags the name of the expected "default archive" is different, but it is not mandatory to have an archive file present - unless it is the plain classes.jsa one ?

And what does Platform.isDefaultCDSArchiveSupported() actually mean now we have the optional COH archive?

@calvinccheung
Copy link
Member Author

I think this test was written for JEP341 where it eliminates and extra step of doing -Xshare:dump and enables -Xshare:auto by default. At that time, there was only one CDS archive (classes.jsa). It gets more complicated now with the COH option. I'm fine with removing this test. If the "default" archive is not available for some reasons, other tests such as the dynamic CDS archive tests would fail so we have coverage there.

Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

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

LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 26, 2024
@iklam
Copy link
Member

iklam commented Nov 26, 2024

There are also other test cases that call Platform.isDefaultCDSArchiveSupported(). I think these probably need to be cleaned up / removed (in separate RFE?)

./lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java:                "areCustomLoadersSupportedForCDS", "isDefaultCDSArchiveSupported",
./jdk/tools/jlink/plugins/CDSPluginTest.java:        if (!Platform.isDefaultCDSArchiveSupported())
./hotspot/jtreg/runtime/cds/CheckSharingWithDefaultArchive.java:        if (!Platform.isDefaultCDSArchiveSupported()) {
./hotspot/jtreg/runtime/cds/CheckDefaultArchiveFile.java:            if (Platform.isDefaultCDSArchiveSupported()) {
./hotspot/jtreg/runtime/cds/CheckDefaultArchiveFile.java:            if (Platform.isDefaultCDSArchiveSupported()) {
./hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClass.java:        if (!Platform.isDefaultCDSArchiveSupported()) {
./lib/jdk/test/lib/Platform.java:    public static boolean isDefaultCDSArchiveSupported() {


Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

LGTM2

@iklam
Copy link
Member

iklam commented Nov 26, 2024

The PR summary needs to be updated.

@calvinccheung
Copy link
Member Author

There are also other test cases that call Platform.isDefaultCDSArchiveSupported(). I think these probably need to be cleaned up / removed (in separate RFE?)

./lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java:                "areCustomLoadersSupportedForCDS", "isDefaultCDSArchiveSupported",
./jdk/tools/jlink/plugins/CDSPluginTest.java:        if (!Platform.isDefaultCDSArchiveSupported())
./hotspot/jtreg/runtime/cds/CheckSharingWithDefaultArchive.java:        if (!Platform.isDefaultCDSArchiveSupported()) {
./hotspot/jtreg/runtime/cds/CheckDefaultArchiveFile.java:            if (Platform.isDefaultCDSArchiveSupported()) {
./hotspot/jtreg/runtime/cds/CheckDefaultArchiveFile.java:            if (Platform.isDefaultCDSArchiveSupported()) {
./hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClass.java:        if (!Platform.isDefaultCDSArchiveSupported()) {
./lib/jdk/test/lib/Platform.java:    public static boolean isDefaultCDSArchiveSupported() {

Other than CheckDefaultArchiveFile.java, the other tests seem to be running fine so far. Will file bug if the other tests start failing.

@calvinccheung
Copy link
Member Author

Thanks for the reviews.

/integrate

@openjdk
Copy link

openjdk bot commented Nov 26, 2024

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

  • d752f19: 8343427: Class file load hook crashes on archived classes from multi-release JARs
  • f1b5a6e: 8344565: SM cleanup in jdk/internal and java/lang package private classes
  • d8a2337: 8344895: SM cleanup of module java.xml
  • c329f97: 8345015: Remove unused method lookup_time_t_function
  • 86d527f: 8344949: javax.security.auth.Subject.SecureSet.writeObject does not do a security check anymore
  • f0b72f7: 8342380: Implement JEP 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe
  • fc2da15: 8344419: Use StaticProperty in some JDK classes
  • 3e509c8: 8344773: SM cleanup in ForkJoinPool
  • 6da3ecd: 8344960: RISC-V: fix TestFloatConversionsVectorNaN for COH and AlignVector
  • 9291abc: 8342074: Fix runtime/Thread/TestAlwaysPreTouchStacks.java to be flagless or accept VM flags
  • ... and 168 more: https://git.openjdk.org/jdk/compare/9e92a9e2bab04b79626b88a7dd017dd0def04d7a...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 26, 2024

@calvinccheung Pushed as commit 2465526.

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

@calvinccheung calvinccheung deleted the 8344821-CheckDefaultArchiveFile branch November 26, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants