JDK-8228903 : [Graal] TestStringIntrinsics.java fails with: Result of 'compareTo' not equal to expected value
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 14
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2019-07-31
  • Updated: 2019-10-11
  • Resolved: 2019-10-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 14
14Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
        compiler.intrinsics.string.TestStringIntrinsics
----------System.err:(15/1062)----------
java.lang.RuntimeException: Result of 'compareTo' not equal to expected value.
	at compiler.intrinsics.string.TestStringIntrinsics.invokeAndCheck(TestStringIntrinsics.java:254)
	at compiler.intrinsics.string.TestStringIntrinsics.checkIntrinsics(TestStringIntrinsics.java:153)
	at compiler.intrinsics.string.TestStringIntrinsics.run(TestStringIntrinsics.java:85)
	at compiler.intrinsics.string.TestStringIntrinsics.main(TestStringIntrinsics.java:60)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:830)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test
Comments
The fix should be pulled in by the next Graal Update JDK-8229201.
19-08-2019

This also caused failures with compiler/intrinsics/Test8005419.java (see JDK-8229851).
19-08-2019

Should be fixed by https://github.com/oracle/graal/commit/026aca1938b43270ff0b7b7511b8f8bf9d2e02ce
13-08-2019

https://github.com/oracle/graal/pull/299#issuecomment-520361690
12-08-2019

Simple reproducer: ``` package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.core.test.GraalCompilerTest; import org.junit.Test; public class StringBugTest extends GraalCompilerTest { public static int test(String str, String copy) { return str.compareTo(copy); } @Test public void testLatin() { StringBuilder latin1Builder = new StringBuilder(); for (int j = 0; j <= 255; ++j) { latin1Builder.append((char) j); } String latin1 = latin1Builder.toString(); test("test", latin1, String.valueOf(latin1.toCharArray())); } } ``` The test above passes on 8, fails on 11. Pass (on 11) by disabling compact Strings e.g. mx -J"-XX:-CompactStrings" unittest org.graalvm.compiler.replacements.test.StringBugTest Pass (on 11) with AVX512VLBW extensions disabled.
12-08-2019

One of: - avx512dq - avx512bw - avx512vl seems to be the key differentiator between machines that see problems and those that don't - as per investigations related to JDK-8229204 .
07-08-2019

It would be very useful if the error message showed more detail including the arguments to the test that failed. I've opened JDK-8229186 for this.
06-08-2019

The command line looks good. The issue seems to be very intermittent though, it only showed up twice on Linux x86_64.
06-08-2019

I'm having no luck reproducing on my Mac. Do I need to change my command line? ~/jtreg-4.2/bin/jtreg -verbose:all -noreport -jdk:build/macosx-x86_64-server-release/images/jdk -javaoptions:'-XX:+CreateCoredumpOnCrash -ea -esa -server -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -Djvmci.Compiler=graal -XX:MaxRAMPercentage=6' open/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics.java
06-08-2019

Execution is with Graal as JIT. The bug has most likely been introduced by the recent Graal Update (JDK-8226771).
05-08-2019

ILW = Incorrect result of compiled code, with Graal as JIT, disable compilation or use different compiler = HMM = P2
05-08-2019