8346316: compiler/rangechecks/TestLongRangeCheck.java fails intermittently with DeoptimizeALot#32041
8346316: compiler/rangechecks/TestLongRangeCheck.java fails intermittently with DeoptimizeALot#32041chhagedorn wants to merge 1 commit into
Conversation
…ently with DeoptimizeALot
|
👋 Welcome back chagedorn! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@chhagedorn The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
Running
compiler/rangechecks/TestLongRangeCheck.javawith-XX:+DeoptimizeALotfails very intermittently with this assert:jdk/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java
Lines 60 to 64 in e0f6001
which means that a method is unexpectedly still compiled. The failing call to
assertIsNotCompiled()is made here:jdk/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java
Lines 315 to 329 in e0f6001
Let's look closer why this can intermittently fail.
What's Supposed to Be Checked
First, let's see what the test does when it passes normally:
We first call
testStridePosScalePosInIntLoopOverflow()with specially constructed arguments:which makes
Preconditions.checkIndex()not fail even in the last iteration wherescale * iis equal toMIN_INT.jdk/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java
Lines 666 to 672 in e0f6001
We then force
compile()the method and inline thePreconditions.checkIndex()intrinsic which emits a trap when we are out of bounds.Afterwards, we call the method again but this time with
offset = 0. In the last iteration, we get an index which is equal toMIN_INTwhich is out of bounds and we hit the trap. We deopt to the interpreter and make the method not entrant.The interpreter then throws an
IOOBEwhich we expect and catch it. Since we deopted and marked the method not entrant, we assert this by callingassertIsNotCompiled(). So far, so good.Problem with
-XX:+DeoptimizeALotWith
DeoptimizeALot, we randomly deoptimize (without making the compiled method not entrant). When running the test withDeoptimizeALot, we could have such a random deoptimization while callingcheckInputs()on L667. We jump to the interpreter, return from the method, callPreconditions.checkIndex()and throw theIOOBE(all in the interpreter). Since we have not hit the C2 emitted trap forPreconditions.checkIndex(), we do not throw the compilation away which means that we fail when callingassertIsNotCompiled()- the method is still compiled.Proposed Solution
Since the test is specifically testing this pattern:
Preconditions.checkIndex()we should not interfere with
DeoptimizeALot. I therefore propose to just not execute this test withDeoptimizeALotTesting
The failure can more reliably be observed (~5-10% failure rate) when running with:
By restricting the test, it will obviously no longer fail with these flags because the test will not be run with
DeoptimizeALot.Thanks,
Christian
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32041/head:pull/32041$ git checkout pull/32041Update a local copy of the PR:
$ git checkout pull/32041$ git pull https://git.openjdk.org/jdk.git pull/32041/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32041View PR using the GUI difftool:
$ git pr show -t 32041Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32041.diff
Using Webrev
Link to Webrev Comment