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

8308184: Launching java with large number of jars in classpath with java.protocol.handler.pkgs system property set can lead to StackOverflowError #2550

Closed

Conversation

srutjay
Copy link
Contributor

@srutjay srutjay commented Jun 7, 2024

This is the backport of the issue : JDK-8308184

Launching java with large number of jars in classpath with java.protocol.handler.pkgs system property set can lead to StackOverflowError


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
  • JDK-8308184 needs maintainer approval

Issue

  • JDK-8308184: Launching java with large number of jars in classpath with java.protocol.handler.pkgs system property set can lead to StackOverflowError (Bug - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/2550/head:pull/2550
$ git checkout pull/2550

Update a local copy of the PR:
$ git checkout pull/2550
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/2550/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2550

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/2550.diff

Webrev

Link to Webrev Comment

Signed-off-by: Sruthy Jayan <srutjay1@in.ibm.com>
@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Jun 7, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 7, 2024

Hi @srutjay, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user srutjay" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

openjdk bot commented Jun 7, 2024

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

8308184: Launching java with large number of jars in classpath with java.protocol.handler.pkgs system property set can lead to StackOverflowError

Reviewed-by: mdoerr

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

  • 08c3774: 8333477: Delete extra empty spaces in Makefiles
  • 938efc0: 8315437: Enable parallelism in vmTestbase/nsk/monitoring/stress/classload tests
  • 433fc2f: 8315442: Enable parallelism in vmTestbase/nsk/monitoring/stress/thread tests
  • d953de6: 8313394: Array Elements in OldObjectSample event has the incorrect description
  • bc5639a: 8325179: Race in BasicDirectoryModel.validateFileCache
  • d3c1ad3: 8261433: Better pkcs11 performance for libpkcs11:C_EncryptInit/libpkcs11:C_DecryptInit
  • 7bc22f7: 8279164: Disable TLS_ECDH_* cipher suites
  • d99641e: 7124313: [macosx] Swing Popups should overlap taskbar
  • 92daaf2: 8331885: C2: meet between unloaded and speculative types is not symmetric
  • 8414ee3: 8294148: Support JSplitPane for instructions and test UI
  • ... and 10 more: https://git.openjdk.org/jdk17u-dev/compare/ce19e6163a388f752a9d1919ad56406865750462...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TheRealMDoerr) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport 268ec61d4fa9c5b7d2c7bcafb942b33e5b189974 8308184: Launching java with large number of jars in classpath with java.protocol.handler.pkgs system property set can lead to StackOverflowError Jun 7, 2024
@openjdk
Copy link

openjdk bot commented Jun 7, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label Jun 7, 2024
@srutjay
Copy link
Contributor Author

srutjay commented Jun 7, 2024

/signed

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Jun 7, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 7, 2024

Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Jun 7, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 7, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 7, 2024

Webrevs

@srutjay
Copy link
Contributor Author

srutjay commented Jun 10, 2024

@offamitkumar / @gnu-andrew Could you please review this commit?

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

LGTM. In the future, please explain what you had to resolve when doing backports. In this case, I can see that you skipped removal of imports because they are still used.

@openjdk
Copy link

openjdk bot commented Jun 11, 2024

⚠️ @srutjay This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@srutjay
Copy link
Contributor Author

srutjay commented Jun 12, 2024

LGTM. In the future, please explain what you had to resolve when doing backports. In this case, I can see that you skipped removal of imports because they are still used.

@TheRealMDoerr

Thank you for reviewing the PR:

Regarding the testing :

I have a sample Java program that prints "Hello, world." After compiling the code, I created two JAR files from the .class file. When I run the Java command with the created JARs in the classpath and the -Djava.protocol.handler.pkgs system property set to a package name, when I use the -verbose option along , the second JAR in the classpath gets loaded first.

To resolve this issue I had done the backports.

@srutjay
Copy link
Contributor Author

srutjay commented Jun 12, 2024

/approval

@openjdk
Copy link

openjdk bot commented Jun 12, 2024

@srutjay usage: /approval [<id>] (request|cancel) [<text>]

@srutjay
Copy link
Contributor Author

srutjay commented Jun 12, 2024

/approval request This backport is necessary to resolve an issue where the second JAR file in the class path is loaded first when two JAR files are specified.

@openjdk
Copy link

openjdk bot commented Jun 12, 2024

@srutjay
8308184: The approval request has been created successfully.

@openjdk openjdk bot added approval ready Pull request is ready to be integrated and removed approval labels Jun 12, 2024
@srutjay
Copy link
Contributor Author

srutjay commented Jun 12, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 12, 2024
@openjdk
Copy link

openjdk bot commented Jun 12, 2024

@srutjay
Your change (at version d2e34da) is now ready to be sponsored by a Committer.

@TheRealMDoerr
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 12, 2024

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

  • 08c3774: 8333477: Delete extra empty spaces in Makefiles
  • 938efc0: 8315437: Enable parallelism in vmTestbase/nsk/monitoring/stress/classload tests
  • 433fc2f: 8315442: Enable parallelism in vmTestbase/nsk/monitoring/stress/thread tests
  • d953de6: 8313394: Array Elements in OldObjectSample event has the incorrect description
  • bc5639a: 8325179: Race in BasicDirectoryModel.validateFileCache
  • d3c1ad3: 8261433: Better pkcs11 performance for libpkcs11:C_EncryptInit/libpkcs11:C_DecryptInit
  • 7bc22f7: 8279164: Disable TLS_ECDH_* cipher suites
  • d99641e: 7124313: [macosx] Swing Popups should overlap taskbar
  • 92daaf2: 8331885: C2: meet between unloaded and speculative types is not symmetric
  • 8414ee3: 8294148: Support JSplitPane for instructions and test UI
  • ... and 10 more: https://git.openjdk.org/jdk17u-dev/compare/ce19e6163a388f752a9d1919ad56406865750462...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 12, 2024

@TheRealMDoerr @srutjay Pushed as commit 0a4f926.

💡 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
backport integrated Pull request has been integrated
2 participants