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

8293041: --disable-@files option doesn't work and cause an error #11183

Closed
wants to merge 2 commits into from

Conversation

asotona
Copy link
Member

@asotona asotona commented Nov 16, 2022

Option --disable-@files is passed to VM option causing it to fail.
Proposed patch skips --disable-@files option in src/java.base/share/native/libjli/java.c ParseArguments processing, so it is not passed to the VM.
The patch also adds relevant test to ArgsFileTest.

Please review.

Thank you,
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-8293041: --disable-@files option doesn't work and cause an error

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11183

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 16, 2022

👋 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 Nov 16, 2022
@openjdk
Copy link

openjdk bot commented Nov 16, 2022

@asotona The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot-runtime hotspot-runtime-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Nov 16, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 16, 2022

Webrevs

@AlanBateman
Copy link
Contributor

Are you sure this is right place to do this? There are other "launcher options" that aren't passed through to CreateJavaVM and I'm surprised this one is.

@asotona
Copy link
Member Author

asotona commented Nov 16, 2022

Are you sure this is right place to do this? There are other "launcher options" that aren't passed through to CreateJavaVM and I'm surprised this one is.

I've found this place as a single spot handling (or skipping) tons of options and as a source of the error message.
The launcher code I've investigated provides a lot of checking, however no suitable place to skip any option. Filtering in launcher would require significant refactoring, or repeated filtering on many spots to handle all alternative paths (unless I missed something important).

Alternate suggestions are welcome, or link to relevant documentation, or an example of another filtered option.

Thanks,
Adam

@AlanBateman
Copy link
Contributor

Alternate suggestions are welcome, or link to relevant documentation, or an example of another filtered option.

I think I would start in ParseArguments (libjli/java.c) to see the options that are handled, translated, or passed through. I can't be 100% sure how this one should be handled without studying it more closely.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

As far as I can see @-file processing is a launcher feature, including the expansion of JDK_JAVA_OPTIONS, so it should never be getting passed through to the VM in the first place.

What I can't figure out is how the test tools/launcher/ArgsFileTest.java is working when the JVM won't start with that flag on the command-line ??

@dholmes-ora
Copy link
Member

dholmes-ora commented Nov 17, 2022

BTW for future reference for the test case we are no longer creating tests using the bug id as a directory, instead tests should be grouped into functional areas. Thanks.

I was also surprised to see the i8N changes here as I thought that was normally handled seperately.

…li/java.c ParseArguments

DisableFilesOptionTest merged to ArgsFileTest::killSwitch
help typo moved to a new bug
@asotona
Copy link
Member Author

asotona commented Nov 18, 2022

@dholmes-ora and @AlanBateman thanks for pointing me to the right place for the fix.

tools/launcher/ArgsFileTest.java was working because it didn't contain any test with --disable-@files option verifying VM really starts

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.

Good to see that this turned out to a simple change.

@openjdk
Copy link

openjdk bot commented Nov 18, 2022

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

8293041: --disable-@files option doesn't work and cause an error

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

  • 761a4f4: 8295788: C2 compilation hits "assert((mode == ControlAroundStripMined && use == sfpt) || !use->is_reachable_from_root()) failed: missed a node"
  • 2f2d404: 8297129: Inflater documentation refers to 'deflate' methods
  • dd18d76: 8297173: usageTicks and totalTicks should be volatile to ensure that different threads get the latest ticks
  • 2b6dbc7: 8293856: AArch64: Remove clear_inst_mark from aarch64_enc_java_dynamic_call
  • 2f063b8: 8296846: Minor cleanup of some dead code in Flow.java
  • ab6b7ef: 8296901: Do not create unsigned certificate and CRL
  • 7b3984c: 8296463: Memory leak in JVM_StartThread with the integration of Virtual threads
  • 373e52c: 8296785: Use realloc for CHeap-allocated BitMaps
  • a53be20: 8282404: DrawStringWithInfiniteXform.java failed with "RuntimeException: drawString with InfiniteXform transform takes long time"
  • 66228f7: 8297074: Use enhanced-for cycle instead of Enumeration in javax.crypto
  • ... and 56 more: https://git.openjdk.org/jdk/compare/65f7de252366e30ba18a22c107fc301c0fdc9378...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 Nov 18, 2022
@asotona
Copy link
Member Author

asotona commented Nov 18, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Nov 18, 2022

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

  • 761a4f4: 8295788: C2 compilation hits "assert((mode == ControlAroundStripMined && use == sfpt) || !use->is_reachable_from_root()) failed: missed a node"
  • 2f2d404: 8297129: Inflater documentation refers to 'deflate' methods
  • dd18d76: 8297173: usageTicks and totalTicks should be volatile to ensure that different threads get the latest ticks
  • 2b6dbc7: 8293856: AArch64: Remove clear_inst_mark from aarch64_enc_java_dynamic_call
  • 2f063b8: 8296846: Minor cleanup of some dead code in Flow.java
  • ab6b7ef: 8296901: Do not create unsigned certificate and CRL
  • 7b3984c: 8296463: Memory leak in JVM_StartThread with the integration of Virtual threads
  • 373e52c: 8296785: Use realloc for CHeap-allocated BitMaps
  • a53be20: 8282404: DrawStringWithInfiniteXform.java failed with "RuntimeException: drawString with InfiniteXform transform takes long time"
  • 66228f7: 8297074: Use enhanced-for cycle instead of Enumeration in javax.crypto
  • ... and 56 more: https://git.openjdk.org/jdk/compare/65f7de252366e30ba18a22c107fc301c0fdc9378...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 18, 2022

@asotona Pushed as commit 13158cb.

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

@dholmes-ora
Copy link
Member

tools/launcher/ArgsFileTest.java was working because it didn't contain any test with --disable-@files option verifying VM really starts

What about the killswitch test ??

@asotona
Copy link
Member Author

asotona commented Nov 21, 2022

tools/launcher/ArgsFileTest.java was working because it didn't contain any test with --disable-@files option verifying VM really starts

What about the killswitch test ??

KillSwitch test did not construct valid command line, it didn't expect VM to start correctly and so it didn't test the VM exit value. KillSwitch test just checked expanded options presence in the debug log (before passing to ParseArguments).
I've added one simple test composing valid cmd line 'java --disable-@files --version' and verifying successful VM execution.

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 hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants