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

8317609: Classfile API fails to verify /jdk.jcmd/sun/tools/jstat/Alignment.class #16123

Closed
wants to merge 1 commit into from

Conversation

asotona
Copy link
Member

@asotona asotona commented Oct 10, 2023

JImageValidator has been recently converted to use ClassFile API and original weak validation of class files was replaced with full class verification.
Unfortunately full class verification is too strong as it includes class assignability verification according to class hierarchy resolution.
This patch relaxes class assignability verification from JImageValidator by mocking ClassHierarchyResolver.
Resolution of all classes as interfaces during verification effectively cancels the assignability verification (as interface assignability is not verified).

Please review this pull request.

Thanks,
Adam


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-8317609: Classfile API fails to verify /jdk.jcmd/sun/tools/jstat/Alignment.class (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16123

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 10, 2023

👋 Welcome back asotona! 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 Oct 10, 2023
@openjdk
Copy link

openjdk bot commented Oct 10, 2023

@asotona To determine the appropriate audience for reviewing this pull request, one or more labels corresponding to different subsystems will normally be applied automatically. However, no automatic labelling rule matches the changes in this pull request. In order to have an "RFR" email sent to the correct mailing list, you will need to add one or more applicable labels manually using the /label pull request command.

Applicable Labels
  • build
  • client
  • compiler
  • core-libs
  • graal
  • hotspot
  • hotspot-compiler
  • hotspot-gc
  • hotspot-jfr
  • hotspot-runtime
  • i18n
  • ide-support
  • javadoc
  • jdk
  • jmx
  • kulla
  • net
  • nio
  • security
  • serviceability
  • shenandoah

Copy link
Member

@liach liach left a comment

Choose a reason for hiding this comment

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

On a side note, it seems weird that you need to pass a CHR again for verification instead of reusing the one from Class-File context object. Maybe we can consider moving verify to Class-File object for a new RFE?

@asotona
Copy link
Member Author

asotona commented Oct 11, 2023

Maybe we can consider moving verify to Class-File object for a new RFE?

Yes, that would be appropriate.

@asotona
Copy link
Member Author

asotona commented Oct 11, 2023

/label core-libs

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Oct 11, 2023
@openjdk
Copy link

openjdk bot commented Oct 11, 2023

@asotona
The core-libs label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Oct 11, 2023

Webrevs

@openjdk
Copy link

openjdk bot commented Oct 31, 2023

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

8317609: Classfile API fails to verify /jdk.jcmd/sun/tools/jstat/Alignment.class

Reviewed-by: liach, 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 314 new commits pushed to the master branch:

  • 47624f6: 8299058: AssertionError in sun.net.httpserver.ServerImpl when connection is idle
  • 2d5829a: 8239508: JFR: @RemoveFields
  • 0064cf9: 8311596: Add separate system properties for TLS server and client for maximum chain length
  • 3a7525d: 8309118: HttpClient: Add more tests for 100 ExpectContinue with HTTP/2
  • f4c5db9: 8318908: Parallel: Remove ExtendedCardValue
  • 7452d50: 8318940: [JVMCI] do not set HotSpotNmethod oop for a default HotSpotNmethod
  • 3e39d7b: 8319136: Skip pkcs11 tests on linux-aarch64
  • ee6f25b: 8319120: Unbound ScopedValue.get() throws the wrong exception
  • e05cafd: 8318467: [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads
  • d3c3f0e: 8317951: Refactor loading of zip library to help resolve JDK-8315220
  • ... and 304 more: https://git.openjdk.org/jdk/compare/ad7a8e86e0334390f87ae44cf749d2b47f1409a1...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 Oct 31, 2023
@asotona
Copy link
Member Author

asotona commented Oct 31, 2023

@AlanBateman Thank you!

@asotona
Copy link
Member Author

asotona commented Oct 31, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Oct 31, 2023

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

  • 47624f6: 8299058: AssertionError in sun.net.httpserver.ServerImpl when connection is idle
  • 2d5829a: 8239508: JFR: @RemoveFields
  • 0064cf9: 8311596: Add separate system properties for TLS server and client for maximum chain length
  • 3a7525d: 8309118: HttpClient: Add more tests for 100 ExpectContinue with HTTP/2
  • f4c5db9: 8318908: Parallel: Remove ExtendedCardValue
  • 7452d50: 8318940: [JVMCI] do not set HotSpotNmethod oop for a default HotSpotNmethod
  • 3e39d7b: 8319136: Skip pkcs11 tests on linux-aarch64
  • ee6f25b: 8319120: Unbound ScopedValue.get() throws the wrong exception
  • e05cafd: 8318467: [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads
  • d3c3f0e: 8317951: Refactor loading of zip library to help resolve JDK-8315220
  • ... and 304 more: https://git.openjdk.org/jdk/compare/ad7a8e86e0334390f87ae44cf749d2b47f1409a1...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 31, 2023

@asotona Pushed as commit f1e8787.

💡 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
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants