-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: hotspot
Ideas from [~epeter]:
Randomly generate some loop shapes with RangeChecks and checkIndex/L and MemorySegment.
Make sure all sorts of addressing shapes are generated, including the ConvI2L pattern of this PR here.
Make sure the generation has a good structure, so we can easily extend with more patterns.
First, pick the accessed range so that we have everything in bounds. Warmup and compilation should happen under this condition.
Then, generate some out of bounds range, call the method and verify that the exception is triggered, and other side effects are also correct (e.g. half-written arrays).
Bonus: find a way to generate IR rule, and verify the RCE happened, and no unexpected RangeCheck/if is still in the loop.
Such a fuzzer should probably be integrated separately. But I would prefer if we had such testing before we are adding more optimizations in this sensitive area.
This test below was used to verify aliasing, but it generates various loop shapes and does value verification, as well as IR verification - so it may be an inspiration:
test/hotspot/jtreg/compiler/loopopts/superword/TestAliasingFuzzer.java
ref. https://github.com/openjdk/jdk/pull/29392#issuecomment-3952447798
Randomly generate some loop shapes with RangeChecks and checkIndex/L and MemorySegment.
Make sure all sorts of addressing shapes are generated, including the ConvI2L pattern of this PR here.
Make sure the generation has a good structure, so we can easily extend with more patterns.
First, pick the accessed range so that we have everything in bounds. Warmup and compilation should happen under this condition.
Then, generate some out of bounds range, call the method and verify that the exception is triggered, and other side effects are also correct (e.g. half-written arrays).
Bonus: find a way to generate IR rule, and verify the RCE happened, and no unexpected RangeCheck/if is still in the loop.
Such a fuzzer should probably be integrated separately. But I would prefer if we had such testing before we are adding more optimizations in this sensitive area.
This test below was used to verify aliasing, but it generates various loop shapes and does value verification, as well as IR verification - so it may be an inspiration:
test/hotspot/jtreg/compiler/loopopts/superword/TestAliasingFuzzer.java
ref. https://github.com/openjdk/jdk/pull/29392#issuecomment-3952447798
- blocks
-
JDK-8356184 C2 MemorySegment: long RangeCheck with ConvI2L(iv + invar) prevents RCE
-
- In Progress
-
- relates to
-
JDK-8365985 C2 SuperWord: TestAliasingFuzzer.java improvements: IR rules, Unsafe access, MemorySegment slicing, long constants and more invar
-
- Open
-
-
JDK-8378566 C2: Add stress option to verify range check elimination
-
- Open
-