Skip to content

Conversation

@jaikiran
Copy link
Member

@jaikiran jaikiran commented Sep 13, 2025

Can I please get a review of this test-only change which addresses the test failure in sun/security/util/AlgorithmConstraints/InvalidCryptoDisabledAlgos.java?

As noted in https://bugs.openjdk.org/browse/JDK-8367583, this test fails when run in our CI. The test intentionally sets up some Security property which is expected to cause a ExceptionInInitializerError when a security API is used. The test also uses the jdk.test.lib.Utils test library which in its static block has a piece of code which intializes a MessageDigest conditionally depending on whether or not the build part of the Runtime.version() is greater than 0. The initialization of MessageDigest during the static initialization of the Utils class leads to certain security APIs to be used too early and thus causing the ExceptionInInitializerError much before the test expected. The test thus ends up failing in that case.

For local builds, build number is by default 0, so this failure wasn't observed locally. In order to reproduce this issue, I built a local JDK with:

bash configure --with-version-build=42
make clean images

I then ran this test against this built JDK and it was able to reproduce this failure.

The change in this PR updates the test to no longer use the test library's Utils class and thus avoids this issue. The test continues to test the same APIs and expectations that it was previously doing, except that it does it without the use of this test utility class. I have run this test change locally against a JDK with build number 0 and against a JDK build number greater than 0 and it passes against both.

I'll launched a CI run just to make sure nothing else fails with this change.


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-8367583: sun/security/util/AlgorithmConstraints/InvalidCryptoDisabledAlgos.java fails after JDK-8244336 (Bug - P2)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27269

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 13, 2025

👋 Welcome back jpai! 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 Sep 13, 2025

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

8367583: sun/security/util/AlgorithmConstraints/InvalidCryptoDisabledAlgos.java fails after JDK-8244336

Reviewed-by: weijun

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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
Copy link

openjdk bot commented Sep 13, 2025

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

  • security

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 security security-dev@openjdk.org rfr Pull request is ready for review labels Sep 13, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 13, 2025

Webrevs

Copy link
Contributor

@wangweij wangweij left a comment

Choose a reason for hiding this comment

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

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 13, 2025
@jaikiran
Copy link
Member Author

I've seen this before. https://bugs.openjdk.org/browse/JDK-8345578.

Thank you Weijun for the review. The conditional code in Utils test library class surprised me and looking at why it was introduced, it appears to be done as part of https://bugs.openjdk.org/browse/JDK-8253750. The motivation to do that I think is reasonable, so I won't pursue any changes to the Utils class further.

For this current PR, would you suggest I wait for further reviews or would it be OK to go ahead with the integration? Locally I have verified this test now works (and used to previously fail). In our CI I have run tier2 and just this test too and that too passed (but that isn't of much consequence because the build number used in those runs will be 0).

@jaikiran
Copy link
Member Author

I spoke to Weijun and we decided to integrate this.

@jaikiran
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 13, 2025

Going to push as commit ff538c7.

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

openjdk bot commented Sep 13, 2025

@jaikiran Pushed as commit ff538c7.

💡 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 security security-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants