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

8312181: CDS dynamic dump crashes when verifying unlinked class from static archive #15077

Closed

Conversation

calvinccheung
Copy link
Member

@calvinccheung calvinccheung commented Jul 28, 2023

During CDS dynamic dump, VM crashes due to assert(!k->is_shared()) failed while linking an old class (class file version <= 49) loaded from the static archive. The fix mostly adjusts some assert statements based on static vs dynamic dumping. In MetaspaceShared::try_link_class, if linking of a shared class during dynamic dump has failed, the shared_loading_failed flag will be set to avoid linking the same class again.

Passed tiers 1 - 4 testing.


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-8312181: CDS dynamic dump crashes when verifying unlinked class from static archive (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15077

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

Using diff file

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

Webrev

Link to Webrev Comment

@calvinccheung
Copy link
Member Author

/label add hotspot-runtime

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 28, 2023

👋 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.

@calvinccheung calvinccheung marked this pull request as ready for review July 28, 2023 21:21
@openjdk openjdk bot added rfr Pull request is ready for review hotspot-runtime hotspot-runtime-dev@openjdk.org labels Jul 28, 2023
@openjdk
Copy link

openjdk bot commented Jul 28, 2023

@calvinccheung
The hotspot-runtime label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Jul 28, 2023

Webrevs

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.

Looks good to me. Thanks for fixing this issue.

@@ -700,7 +700,7 @@ bool SystemDictionaryShared::add_verification_constraint(InstanceKlass* k, Symbo
Arguments::assert_is_dumping_archive();
DumpTimeClassInfo* info = get_info(k);
info->add_verification_constraint(k, name, from_name, from_field_is_protected,
from_is_array, from_is_object);
from_is_array, from_is_object);
Copy link
Member

Choose a reason for hiding this comment

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

Unintended whitespace change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I've reverted the change.

Copy link
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just one note about a typo

/*
* @test
* @bug 8312181
* @summary Archive an old class, which fails verification and a supertype of another
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo with the summary:

Archive an old class, which fails verification and is a supertype of another

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your review. I'll fix the typo before integrating the fix.

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
Copy link

openjdk bot commented Aug 1, 2023

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

8312181: CDS dynamic dump crashes when verifying unlinked class from static archive

Reviewed-by: iklam, matsaave

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

  • ec2f38f: 8313428: GHA: Bump GCC versions for July 2023 updates
  • 98a915a: 8313256: Exclude failing multicast tests on AIX
  • 94b50b7: 8313404: Fix section label in test/jdk/ProblemList.txt
  • ee3e091: 8313249: Fix -Wconversion warnings in verifier code
  • e36960e: 8312420: Integrate Graal's blender micro benchmark
  • 0a3c6d6: 8280482: Window transparency bug on Linux

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 Aug 1, 2023
@calvinccheung
Copy link
Member Author

Thanks @iklam and @matias9927 for the review.

/integrate

@openjdk
Copy link

openjdk bot commented Aug 1, 2023

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

  • 7ba8c69: 8312596: Null pointer access in Compile::TracePhase::~TracePhase after JDK-8311976
  • ec2f38f: 8313428: GHA: Bump GCC versions for July 2023 updates
  • 98a915a: 8313256: Exclude failing multicast tests on AIX
  • 94b50b7: 8313404: Fix section label in test/jdk/ProblemList.txt
  • ee3e091: 8313249: Fix -Wconversion warnings in verifier code
  • e36960e: 8312420: Integrate Graal's blender micro benchmark
  • 0a3c6d6: 8280482: Window transparency bug on Linux

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 1, 2023

@calvinccheung Pushed as commit bf70777.

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

@calvinccheung calvinccheung deleted the 8312181-dynamic-dump-crash branch August 1, 2023 20:35
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
3 participants