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

8267347: CDS record_linking_constraint asserts with unregistered class #4147

Closed

Conversation

iklam
Copy link
Member

@iklam iklam commented May 21, 2021

In CDS terms, "Unregistered classes" are the archived classes that should be loaded by custom class loaders during runtime. Archiving of class loader constraints (JDK-8178349) should be disabled for such classes.

During CDS dump time (-Xshare:dump), unregistered classes are loaded by the boot loader (see also JDK-8261941). SystemDictionaryShared::record_linking_constraint doesn't properly recognize such classes, leading to the assert.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8267347: CDS record_linking_constraint asserts with unregistered class

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4147/head:pull/4147
$ git checkout pull/4147

Update a local copy of the PR:
$ git checkout pull/4147
$ git pull https://git.openjdk.java.net/jdk pull/4147/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4147

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4147.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented May 21, 2021

👋 Welcome back iklam! 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 openjdk bot commented May 21, 2021

@iklam 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 label May 21, 2021
@iklam iklam changed the title 8267347: CDS record_linking_constraint asserts with unregistered class 8267340: CDS record_linking_constraint asserts with unregistered class May 21, 2021
@iklam iklam force-pushed the 8267347-record_linking_constraint-asserts branch from c5b62ce to ee9a22f Compare May 21, 2021
@iklam iklam changed the title 8267340: CDS record_linking_constraint asserts with unregistered class 8267347: CDS record_linking_constraint asserts with unregistered class May 21, 2021
@iklam iklam marked this pull request as ready for review May 21, 2021
@openjdk openjdk bot added the rfr label May 21, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented May 21, 2021

Webrevs

yminqi
yminqi approved these changes May 21, 2021
Copy link
Contributor

@yminqi yminqi left a comment

LGTM.

String topArchiveName = getNewArchiveName();
String testCase = Integer.toString(i);
String cmdLine[] = new String[] {
"-cp", appJar,
"--add-modules",
"--add-modules",
Copy link
Contributor

@yminqi yminqi May 21, 2021

Choose a reason for hiding this comment

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

Here is not aligned with below.

Copy link
Member Author

@iklam iklam May 24, 2021

Choose a reason for hiding this comment

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

Fixed.

@openjdk
Copy link

@openjdk openjdk bot commented May 21, 2021

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

8267347: CDS record_linking_constraint asserts with unregistered class

Reviewed-by: minqi, ccheung

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 openjdk bot added the ready label May 21, 2021
httpHandlerClass,
httpExchangeClass,
Asserts.class.getName(),
Copy link
Member

@calvinccheung calvinccheung May 21, 2021

Choose a reason for hiding this comment

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

Why other class names don't need to do replace(".", "/")?

Copy link
Member Author

@iklam iklam May 24, 2021

Choose a reason for hiding this comment

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

The problem is that the classlist requires the slash separator. I.e., com/sun/net/httpserver/HttpHandler must be used. In contrast, ClassFileInstaller.writeJar() allows both jdk.test.lib.Asserts and jdk/test/lib/Asserts. Since the Asserts class is used only by ClassFileInstaller, I left it as is.

To make it easier to write test cases, I have filed https://bugs.openjdk.java.net/browse/JDK-8267624 "CDS classlist should allow both . and / in class names"



// This is a handy class for running an application inside a custom class loader. This
// is used for testing CDS handling of unregistered classes (i.e., archved classes loaded
Copy link
Member

@calvinccheung calvinccheung May 21, 2021

Choose a reason for hiding this comment

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

Typo: archved -> archived

Copy link
Member Author

@iklam iklam May 24, 2021

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

@calvinccheung calvinccheung left a comment

Looks good. Just one question and one nit.

@iklam
Copy link
Member Author

@iklam iklam commented May 24, 2021

Thanks to @calvinccheung and @yminqi for the review.
/integrate

@openjdk openjdk bot closed this May 24, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels May 24, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 24, 2021

@iklam Since your change was applied there has been 1 commit pushed to the master branch:

  • a5467ae: 8267423: Fix copyrights in jpackage tests

Your commit was automatically rebased without conflicts.

Pushed as commit 209769b.

💡 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
hotspot-runtime integrated
4 participants