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
8288483: JAVA_TOOL_OPTIONS are silently truncated if they exceed 1024 bytes #74
Conversation
👋 Welcome back dsamersoff! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: in arguments.hpp, move the declaration or parse_arguments_buffer down 2 lines after parse_java_options_environment variable to match tip's relative placement.
Otherwise fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
@dsamersoff This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
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 254 new commits pushed to the
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 |
@dsamersoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
/open |
@phohensee Only the pull request author can set the pull request state to "open" |
/open |
@dsamersoff This pull request is already open |
@dsamersoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
/open |
@dsamersoff This pull request is already open |
This seems a high-risk backport. As far as I can see it's not explained why it's needed. Especially why now? 8u has been around for some time without that fix. We cannot just backport everything. |
I tend to agree with Severin here. Generally, enhancements shouldn't be backported. Also, I don't see why this is being introduced under a new bug ID, and this is effectively hiding two enhancements inside a bug. The relevant fix for the 1024 limit is JDK-8135195, but that issue is referring to a limit on an options file, which is not supported in 8u, as it doesn't have JDK-8061999. This patch doesn't backport the options file support, so is effectively treading new ground in lifting the limit just for the environment variable, but with most of the code changes from the aforementioned bugs. I think they may be a case for a simpler fix that improves From
So |
The main rationally behind these changes is to fix spec violation. JDK 8 specification does not set any limits for JAVA_TOOL_OPTIONS length and number of items, so every time when a customer steps into this problem, it gets escalated, and it is not possible to argue that this is the expected OpenJDK behavior. Please look at the testcase https://github.com/dsamersoff/jdk_8288483_scratchpad/pull/2/files (this testcase is not a part of PR because it doesn’t exist in the upstream) Codewise, the code is essentially the same to what we have in 11u with some minimal changes required to accommodate API difference. Please, look at https://github.com/dsamersoff/jdk_8288483_scratchpad/pull/1/files for difference between 11u (left) and what is proposed to 8u (right). |
@dsamersoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
/open |
@dsamersoff This pull request is already open |
@dsamersoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
/open |
@dsamersoff This pull request is already open |
@dsamersoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@dsamersoff This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
/open |
@dsamersoff This pull request is now open |
@dsamersoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@dsamersoff This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
The JAVA_TOOL_OPTIONS environment variable is used to pass additional JVM arguments.
The current implementation in jdk8 has an internal limit on the length of the option variable (1024 bytes) and the number of options (64).
A longer variable will be silently truncated and some options will be lost or the VM will exist with an unrecognized option error.
The fix is not a direct backport of the changes in the later JDKs, but I kept the code as close as possible to what we have in the latest jdk.
It's partial backport of relevant changes from JDK-8135195, JDK-8074895, JDK-8061999
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/74/head:pull/74
$ git checkout pull/74
Update a local copy of the PR:
$ git checkout pull/74
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/74/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 74
View PR using the GUI difftool:
$ git pr show -t 74
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/74.diff
Webrev
Link to Webrev Comment