jdk8u-dev
jdk8u-dev copied to clipboard
8159695: Arguments::atojulong() fails to detect overflows
Hi all, this is a backport of JDK-8159695: Arguments::atojulong() fails to detect overflows. The bug reported is reproducible in JDK8, so this patch should be applied. The original patch does not apply cleanly, and the following modifications are needed:
- Lines related to hexadecimal numbers are skipped because support for hexadecimal numbers as a VM option, corresponding to JDK-8042885, was not introduced until JDK9.
- The accompanying test to check the functionality of the atojulong() function is dropped because it is a GTest, which is not available in JDK8.
Note that atomull() was renamed to atojulong() in JDK9 as part of the enhancement JDK-8153073, which supports suffixes in memory size options. Testing
- Manually check the behaviour When a given value is too large to fit in a julong, the proper exception is raised with this patch.
without patch
java -XX:GCDrainStackTargetSize=999999999999999999999999999999 -XX:+PrintFlagsFinal -version | grep StackTarget
uintx GCDrainStackTargetSize := 18446744073709551615 {product}
with patch
java -XX:GCDrainStackTargetSize=999999999999999999999999999999 -XX:+PrintFlagsFinal -version
Improperly specified VM option 'GCDrainStackTargetSize=999999999999999999999999999999'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
- hotspot_tier1
Thank you.
Progress
- [x] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [ ] JDK-8159695 needs maintainer approval
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8159695: Arguments::atojulong() fails to detect overflows (Bug - P3 - Requested)
Reviewers
- Paul Hohensee (@phohensee - Reviewer)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/428/head:pull/428
$ git checkout pull/428
Update a local copy of the PR:
$ git checkout pull/428
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/428/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 428
View PR using the GUI difftool:
$ git pr show -t 428
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/428.diff
Using Webrev
:wave: Welcome back ktakakuri! 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.
This backport pull request has now been updated with issue from the original commit.
@ktakakuri 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!
⚠️ @ktakakuri 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.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
@ktakakuri 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!
As phohensee has pointed out ,strtoull needs to be declared for Windows-x86. A corresponding fix exists in JDK9, but it's in a different context. I am currently working on backporting this fix in issue #434. Once issue #434 is integrated, the build failure will be resolved and GHA result is fine (see #434).
/approval request Fix Request 8u This bug is reproducible in JDK8, and backporting this patch is needed. The patch does not apply cleanly, with GTest and hexadecimal-related lines being dropped. Low risk as it only relates to edge cases of the string-julong conversion. For building in Windows x86, the appropriate macro definition is needed and the correspoding backport has been submitted. Tesing: GHA, hotspot_tier1, and manually check the behaviour.
@ktakakuri 8159695: The approval request has been created successfully.
@ktakakuri 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!
@ktakakuri 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 pull request command.
/open
@ktakakuri This pull request is now open
I think this one should depend on #434, not the other way around, so VS2010 builds pass.
I think it would be good to merge this backport after #434 is merged. The fix is no problem as is.
@ktakakuri 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!
This pull request is pending approval of the Fix Request. I comment to not close.
@ktakakuri 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!
This pull request is pending approval of the Fix Request. I comment to not close.
@ktakakuri 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!
This pull request is pending approval of the Fix Request. I comment to not close.