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

8322809: SystemModulesMap::classNames and moduleNames arrays do not match the order #17316

Closed
wants to merge 4 commits into from

Conversation

mlchung
Copy link
Member

@mlchung mlchung commented Jan 9, 2024

One optimization of Jlink SystemModulesPlugin pre-resolves the module graph for modules with a main class. It stores the name of the initial module and the generated SystemModules class name in two arrays that can be obtained from SystemModulesMap::moduleNames and SystemModulesMap::classNames. The elements in the array returned by classNames() are supposed to correspond to the elements in the array returned by moduleNames(). However, the implementation sorts both arrays by the value of the elements.

This fix is simple and write the correct class names and not to sort the values separately.


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-8322809: SystemModulesMap::classNames and moduleNames arrays do not match the order (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17316

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

Using diff file

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

Webrev

Link to Webrev Comment

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 9, 2024

👋 Welcome back mchung! 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 Jan 9, 2024
@openjdk
Copy link

openjdk bot commented Jan 9, 2024

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Jan 9, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 9, 2024

Webrevs

*/

module com.foo {
requires jdk.httpserver;
Copy link
Contributor

@AlanBateman AlanBateman Jan 9, 2024

Choose a reason for hiding this comment

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

This requires means the run-time image created by the test will have 3 modules with main classes. It needs a minimum of 2 so this dependency is okay.

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 and net.foo requires jdk.jfr which also has a main class. The run-time image created by this test has 4 modules.


private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
private static final Path MODS_DIR = Paths.get("mods");
private static final Path JMODS_DIR = Paths.get("jmods");
Copy link
Contributor

Choose a reason for hiding this comment

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

In passing, these can use Path.of if you want.

Copy link
Contributor

@AlanBateman AlanBateman 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, surprising we didn't notice this before now but perhaps not too common to have several modules in the run-time image with a main class. I assume you'll bump the copyright header of SystemModulesPlugin before integrating.

@openjdk
Copy link

openjdk bot commented Jan 9, 2024

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

8322809: SystemModulesMap::classNames and moduleNames arrays do not match the order

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

  • ee98d26: 8323066: gc/g1/TestSkipRebuildRemsetPhase.java fails with 'Skipping Remembered Set Rebuild.' missing
  • 886386c: 8322890: Directly return in OldPLABSizeConstraintFunc
  • 438ab7c: 8323284: Remove unused FilteringClosure declaration
  • 52c7ff1: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC
  • ff499ef: 8233443: G1 DetailedUsage class names overly generic for global namespace
  • 37a6172: 8322936: Update blessed-modifier-order.sh for default, sealed, and non-sealed
  • 7d42aa1: 8310277: jdk/javadoc/doclet/testMethodCommentAlgorithm/TestMethodCommentsAlgorithm.java fails with IllegalStateException
  • 6e9671a: 8323264: Serial: Remove unused GenerationBlockSizeClosure
  • 52a6c37: 8322858: compiler/c2/aarch64/TestFarJump.java fails on AArch64 due to unexpected PrintAssembly output
  • 075fed9: 8323241: jcmd manpage should use lists for argument lists
  • ... and 6 more: https://git.openjdk.org/jdk/compare/841ab487f83d7e3639d352e796dc7131310c2390...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 Jan 9, 2024
@mlchung
Copy link
Member Author

mlchung commented Jan 9, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Jan 9, 2024

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

  • bc05893: 8323318: Remove unused Space::is_free_block
  • dd8ae61: 8322237: Heap dump contains duplicate thread records for mounted virtual threads
  • ee98d26: 8323066: gc/g1/TestSkipRebuildRemsetPhase.java fails with 'Skipping Remembered Set Rebuild.' missing
  • 886386c: 8322890: Directly return in OldPLABSizeConstraintFunc
  • 438ab7c: 8323284: Remove unused FilteringClosure declaration
  • 52c7ff1: 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC
  • ff499ef: 8233443: G1 DetailedUsage class names overly generic for global namespace
  • 37a6172: 8322936: Update blessed-modifier-order.sh for default, sealed, and non-sealed
  • 7d42aa1: 8310277: jdk/javadoc/doclet/testMethodCommentAlgorithm/TestMethodCommentsAlgorithm.java fails with IllegalStateException
  • 6e9671a: 8323264: Serial: Remove unused GenerationBlockSizeClosure
  • ... and 8 more: https://git.openjdk.org/jdk/compare/841ab487f83d7e3639d352e796dc7131310c2390...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 9, 2024

@mlchung Pushed as commit f3be138.

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

@mlchung mlchung deleted the JDK-8322809 branch February 22, 2024 20:29
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.

None yet

2 participants