JDK-8296852 : compiler/c2/irTests/stringopts/TestNegativeArraySize.java failed with "IRViolationException: There were one or multiple IR rule failures."
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17.0.7-oracle
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • Submitted: 2022-11-11
  • Updated: 2022-11-11
  • Resolved: 2022-11-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 17
17-poolResolved
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description
The following test failed in the JDK17 CI:

compiler\\c2\\irTests\\stringopts\\TestNegativeArraySize.java
using options -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation

Here is a snippet from the log file

One or more @IR rules failed:

Failed IR Rules (1)
------------------
- Method "static java.lang.String compiler.c2.irTests.stringopts.TestNegativeArraySize.negativeConst()":
  * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, failOn={}, applyIfAnd={}, applyIfOr={}, counts={"#PRE#(.*precise klass .*#IS_REPLACED#:.*\\\\R((.*(?i:mov|xorl|nop|spill).*|\\\\s*|.*LGHI.*)\\\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)", "StringBuilder", "1", "#PRE#(\\\\d+(\\\\s){2}(Call.*Java.*)+(\\\\s){2}===.*#IS_REPLACED# )", "toString", "1"}, applyIfNot={})"
    - counts: Graph contains wrong number of nodes:
        Regex 2: (\\d+(\\s){2}(Call.*Java.*)+(\\s){2}===.*toString )
        Expected 1 but found 0 nodes.

>>> Check stdout for compilation output of the failed methods

#############################################################
   - To only run the failed tests use -DTest, -DExclude,
     and/or -DScenarios.
   - To also get the standard output of the test VM run with
     -DReportStdout=true or for even more fine-grained logging
     use -DVerbose=true.
  #############################################################


compiler.lib.ir_framework.driver.IRViolationException: There were one or multiple IR rule failures. Please check stderr for more information.
	at compiler.lib.ir_framework.driver.IRMatcher.reportFailuresIfAny(IRMatcher.java:490)
	at compiler.lib.ir_framework.driver.IRMatcher.applyRules(IRMatcher.java:269)
	at compiler.lib.ir_framework.driver.IRMatcher.<init>(IRMatcher.java:71)
	at compiler.lib.ir_framework.TestFramework.runTestVM(TestFramework.java:700)
	at compiler.lib.ir_framework.TestFramework.start(TestFramework.java:669)
	at compiler.lib.ir_framework.TestFramework.start(TestFramework.java:322)
	at compiler.lib.ir_framework.TestFramework.runWithFlags(TestFramework.java:230)
	at compiler.c2.irTests.stringopts.TestNegativeArraySize.main(TestNegativeArraySize.java:44)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:833)

JavaTest Message: Test threw exception: compiler.lib.ir_framework.driver.IRViolationException
JavaTest Message: shutting down test
Comments
I've had a look at the output and there is the message "<!-- safepoint while printing -->" inside the node that we want to match against: 76 CallStaticJava === 53 58 59 8 1 ( 42 1 ) [[ 77 89 90 81 ]] # Static <!-- safepoint while printing --> java.lang.StringBuilder::toString java/lang/String:exact * ( java/lang/StringBuilder:NotNull:exact * ) TestNegativeArraySize::negativeConst @ bci:11 (line 60) !jvms: TestNegativeArraySize::negativeConst @ bci:11 (line 60) We fixed this case in JDK-8271471 and the follow-up fixes JDK-8274911, JDK-8275173, and JDK-8284115. Backporting these should fix this problem. I will therefore close it as dup of these.
11-11-2022