Found by Olivier Mattmann <olivier.mattmann@bluewin.ch> during work on this Master thesis where he is working on a fuzzer for C2.
The attached test case (Test.java) leads C2 to optimize away the array copy which in turn leads to a wrong execution. The test case was derived from compiler/arraycopy/TestLoadBypassACWithWrongMem.java introduced inJDK-8181742. The symptoms look similar, but the setup is now more contrived.
java -XX:-TieredCompilation -Xbatch Test.java
Exception in thread "main" java.lang.RuntimeException: Wrong result from compiled method test1: 16. Expected: 0
at Test.main(Test.java:34)
Possible workarounds: -XX:-DoEscapeAnalysis, -XX:-UseSwitchProfiling, -XX:-UseProfiledLoopPredicate
The attached test case (Test.java) leads C2 to optimize away the array copy which in turn leads to a wrong execution. The test case was derived from compiler/arraycopy/TestLoadBypassACWithWrongMem.java introduced in
java -XX:-TieredCompilation -Xbatch Test.java
Exception in thread "main" java.lang.RuntimeException: Wrong result from compiled method test1: 16. Expected: 0
at Test.main(Test.java:34)
Possible workarounds: -XX:-DoEscapeAnalysis, -XX:-UseSwitchProfiling, -XX:-UseProfiledLoopPredicate
- relates to
-
JDK-8181742 Load that bypasses arraycopy has wrong memory state
-
- Closed
-
-
JDK-8370562 Whitebox Fuzzer for C2
-
- Open
-