JDK-8189828 : [Graal] Graal unit tests fail in -Xcomp mode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2017-10-23
  • Updated: 2023-07-21
  • Resolved: 2023-07-21
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 10
10Resolved
Related Reports
Duplicate :  
Relates :  
Description
Following graal unit tests fail with latest hs10 binaries when running in -Xcomp mode.

org.graalvm.compiler.api.directives.test.BlackholeDirectiveTest
1) testBoolean(org.graalvm.compiler.api.directives.test.BlackholeDirectiveTest)
java.lang.AssertionError: expected no usages of ParameterNode


org.graalvm.compiler.api.directives.test.ControlFlowAnchorDirectiveTest)
1) testMerge(org.graalvm.compiler.api.directives.test.ControlFlowAnchorDirectiveTest)
java.lang.AssertionError: ControlFlowAnchorNode expected:<2> but was:<1>
2) testUnswitch(org.graalvm.compiler.api.directives.test.ControlFlowAnchorDirectiveTest)
java.lang.AssertionError: LoopBeginNode expected:<2> but was:<1>


org.graalvm.compiler.api.directives.test.OpaqueDirectiveTest
1) testBoolean(org.graalvm.compiler.api.directives.test.OpaqueDirectiveTest)
java.lang.AssertionError: expected:<class org.graalvm.compiler.nodes.calc.ConditionalNode> but was:<class org.graalvm.compiler.nodes.ConstantNode>
2) testObject(org.graalvm.compiler.api.directives.test.OpaqueDirectiveTest)
java.lang.AssertionError: expected:<class org.graalvm.compiler.nodes.calc.ConditionalNode> but was:<class org.graalvm.compiler.nodes.ConstantNode>
3) testBranchProbability(org.graalvm.compiler.api.directives.test.ProbabilityDirectiveTest)
java.lang.ClassCastException: jdk.internal.vm.compiler/org.graalvm.compiler.nodes.DeoptimizeNode cannot be cast to jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug.ControlFlowAnchorNode


org.graalvm.compiler.core.test.ConditionalEliminationTest13
1) test4(org.graalvm.compiler.core.test.ConditionalEliminationTest13)
java.lang.AssertionError: Graphs do not have the same number of nodes: 4 vs. 16
mismatch in graphs:
2) test8(org.graalvm.compiler.core.test.ConditionalEliminationTest13)
java.lang.AssertionError: Graphs do not have the same number of nodes: 4 vs. 16
mismatch in graphs:

org.graalvm.compiler.core.test.ea.PEAAssertionsTest
1) testControlFlow1(org.graalvm.compiler.core.test.ea.PEAAssertionsTest)
org.graalvm.compiler.code.SourceStackTraceBailoutException$1: Object of type Ljava/lang/Integer; should not be materialized (must not store virtual object into a field):
        at app//org.graalvm.compiler.core.test.ea.PEAAssertionsTest.snippetControlFlow1(PEAAssertionsTest.java:126)


org.graalvm.compiler.core.test.GuardedIntrinsicTest
1) test01(org.graalvm.compiler.core.test.GuardedIntrinsicTest)
java.lang.AssertionError: [] expected:<1> but was:<0>


org.graalvm.compiler.core.test.HashCodeTest
1) test08(org.graalvm.compiler.core.test.HashCodeTest)
java.lang.AssertionError: expected:<1> but was:<0>


org.graalvm.compiler.core.test.MarkUnsafeAccessTest
1) testStandard(org.graalvm.compiler.core.test.MarkUnsafeAccessTest)
java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code


org.graalvm.compiler.core.test.MergeCanonicalizerTest
1) testSplitReturn(org.graalvm.compiler.core.test.MergeCanonicalizerTest)
java.lang.AssertionError: expected:<2> but was:<1>


org.graalvm.compiler.core.test.ProfilingInfoTest
1) testExceptionSeen(org.graalvm.compiler.core.test.ProfilingInfoTest)
java.lang.AssertionError: expected:<TRUE> but was:<FALSE>
2) testSwitchProbabilities(org.graalvm.compiler.core.test.ProfilingInfoTest)
java.lang.AssertionError: actual array was null
3) testProfileInvokeVirtual(org.graalvm.compiler.core.test.ProfilingInfoTest)
java.lang.NullPointerException
4) testBranchTakenProbability(org.graalvm.compiler.core.test.ProfilingInfoTest)
java.lang.AssertionError: expected:<0.0> but was:<-1.0>
5) testTypeProfileInvokeInterface(org.graalvm.compiler.core.test.ProfilingInfoTest)
java.lang.NullPointerException


org.graalvm.compiler.hotspot.test.ExplicitExceptionTest
1) testNPE(org.graalvm.compiler.hotspot.test.ExplicitExceptionTest)
java.lang.AssertionError: expected:<1> but was:<0>
2) testNPEArray(org.graalvm.compiler.hotspot.test.ExplicitExceptionTest)
java.lang.AssertionError: expected:<2> but was:<0>
3) testAIOOBE(org.graalvm.compiler.hotspot.test.ExplicitExceptionTest)
java.lang.AssertionError: expected:<2> but was:<0>



org.graalvm.compiler.hotspot.test.GraalOSRLockTest
1) testLockOSROuterInnerLockDepthCompileRestOfMethod(org.graalvm.compiler.hotspot.test.GraalOSRLockTest)
java.lang.AssertionError: Unexpected exception expected null, but was:<java.lang.Error: Must part of compiled code>
2) testUnsafeSubstitutions(org.graalvm.compiler.hotspot.test.HotSpotUnsafeSubstitutionTest)
java.lang.AssertionError: 61|Invoke#Throwable.fillInStackTrace
Comments
I have verified and all tests except org.graalvm.compiler.core.test.ProfilingInfoTest now pass with -Xcomp. org.graalvm.compiler.core.test.ProfilingInfoTest fail differently, so it is new issue not related to the fixed one.
08-11-2017

Will be resolved by JDK-8190710.
03-11-2017

As of https://github.com/graalvm/graal/commit/ae813716ed6525dc4db5c51e7ef3cc904f73c18d, these tests should now pass.
31-10-2017

Never mind, I found the issue.
26-10-2017

[~epavlova], is there more of the stack trace available for the org.graalvm.compiler.core.test.MarkUnsafeAccessTest failure? That tests expects an InternalError so it would be useful to see the scope in which the error is being thrown.
26-10-2017

I had a look at the BlackholeDirectiveTest. It fails because the useless if statement in method booleanSnippet(int arg) is not removed by Graal and therefore parameter "arg" is used ("expected no usages of ParameterNode"). This only happens with -Xcomp if the method is already compiled by C1 or C2. Excluding the method from C1/C2 compilation helps: -XX:CompileCommand=exclude,org.graalvm.compiler.api.directives.test.BlackholeDirectiveTest::booleanSnippet Doug, could you please have a look or re-assign? Thanks.
24-10-2017

As best I can tell, all these tests fail because they make an assumption that non-Graal execution of some method is by the interpreter and thus has no profiling info. I'm investigating which tests should be skipped when -Xcomp is specified and which can be made to work with -Xcomp.
24-10-2017

ILW = Graal unit tests fail (test bugs), several tests with -Xcomp, no workaround = MMH = P3
24-10-2017

The tests don't fail if -Xcomp is not used.
23-10-2017