String.indexOf intrinsics fail with +EnableX86ECoreOpts and -CompactStrings

XMLWordPrintable

    • b06

        Found this when testing JDK 25:

        $ CONF=linux-x86_64-server-fastdebug make images test TEST=java/lang/String/IndexOf.java TEST_VM_OPTS=-XX:-CompactStrings

        ...

            FAILED: 80 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddddd[ad]
        (UU)(T3) Trying repeaded needle[2] in haystack[87] at offset[82]
            FAILED: 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadddd[ad]
        (UU)(T3) Trying repeaded needle[2] in haystack[87] at offset[83]
            FAILED: 82 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddd[ad]
        (UU)(T3) Trying repeaded needle[2] in haystack[87] at offset[84]
            FAILED: 83 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadd[ad]
        STDERR:
        java.lang.RuntimeException: IndexOf test failed.
        at IndexOf.main(IndexOf.java:143)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1474)


        I believe only the subtests with -XX:+EnableX86ECoreOpts are failing, because they enter the AVX2-enabled stub added by JDK-8320448:

        #ifdef COMPILER2
          if ((UseAVX == 2) && EnableX86ECoreOpts) {
            generate_string_indexof(StubRoutines::_string_indexof_array);
          }
        #endif

        If I disable that block, the test starts to pass. The failure was caught on AMD Zen 3 machines. I have not tested any Xeons. I doubt it is architecture-specific issue.

              Assignee:
              Volodymyr Paprotski
              Reporter:
              Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: