8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y)#7674
8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y)#7674eme64 wants to merge 3 commits intoopenjdk:masterfrom
Conversation
…xception in void ck(double x, double y)
|
👋 Welcome back eme64! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
/label add nio |
|
@eme64 |
| @@ -217,7 +217,9 @@ void ck(long x, long y) { | |||
|
|
|||
| void ck(double x, double y) { | |||
| if (x == x && y == y && x != y) { | |||
There was a problem hiding this comment.
What are the x == x and y == y checks good for?
There was a problem hiding this comment.
I removed it. @PaulSandoz agreed that this method was very suspect. I should try removing it. There is an off chance it could create some NaN issues on odd platforms.
|
/label remove nio |
|
@eme64 |
|
@eme64 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: 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 13 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. 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 (@PaulSandoz, @TobiHartmann) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
Thanks @PaulSandoz and @TobiHartmann for the help and the reviews! |
|
/sponsor |
|
Going to push as commit a584c90.
Your commit was automatically rebased without conflicts. |
|
@TobiHartmann @eme64 Pushed as commit a584c90. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
| if (x == x && y == y && x != y) { | ||
| ck(x, y); | ||
| if (x != y) { | ||
| throw new RuntimeException(" x = " + Double.toString(x) + ", y = " + Double.toString(y) |
There was a problem hiding this comment.
You might want to add some explanation to the exception:
s/" x = "/"Expected x == y: x = "
or something like that.
There are two functions that check for equality.
void ck(long x, long y): already throws a RuntimeException if we observe inequality
void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError.
Instead of the recursion, I now also throw a RuntimeException.
This can currently be triggered with
path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java(see bug JDK-8282555)
This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired.
Ran some basic tests to ensure I didn't break things.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7674/head:pull/7674$ git checkout pull/7674Update a local copy of the PR:
$ git checkout pull/7674$ git pull https://git.openjdk.java.net/jdk pull/7674/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7674View PR using the GUI difftool:
$ git pr show -t 7674Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7674.diff