JDK-8202124 : [Graal] some whitebox compiler tests fail with Graal
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2018-04-23
  • Updated: 2020-07-17
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.
Other
tbdUnresolved
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8205490 :  
Description
compiler/tiered/TieredLevelsTest.java run with Graal as JIT fails intermittently  with

----------System.out:(26/582)----------
CompileCommand: compileonly compiler/whitebox/SimpleTestCaseHelper.*
TEST CASE:CONSTRUCTOR_TEST
at test's start:

private compiler.whitebox.SimpleTestCaseHelper(int):
	compilable:	true
	compiled:	false
	comp_level:	0
	osr_compilable:	true
	osr_compiled:	false
	osr_comp_level:	0
	in_queue:	false
compile_queues_size:	0

on exception 'expected[1] != actual[4]':
private compiler.whitebox.SimpleTestCaseHelper(int):
	compilable:	true
	compiled:	true
	compile_id:	63
	comp_level:	4
	osr_compilable:	true
	osr_compiled:	false
	osr_comp_level:	0
	in_queue:	false
compile_queues_size:	0

----------System.err:(34/2444)----------
Warning: private compiler.whitebox.SimpleTestCaseHelper(int) is still in queue after 10600ms
java.lang.RuntimeException: expected[1] != actual[4]
	at compiler.tiered.CompLevelsTest.checkLevel(CompLevelsTest.java:76)
	at compiler.tiered.TieredLevelsTest.checkLevel(TieredLevelsTest.java:97)
	at compiler.tiered.CompLevelsTest.testAvailableLevel(CompLevelsTest.java:52)
	at compiler.tiered.TieredLevelsTest.test(TieredLevelsTest.java:77)
	at compiler.whitebox.CompilerWhiteBoxTest.runTest(CompilerWhiteBoxTest.java:176)
	at compiler.whitebox.CompilerWhiteBoxTest.main(CompilerWhiteBoxTest.java:135)
	at compiler.tiered.TieredLevelsTest.main(TieredLevelsTest.java:49)
	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:569)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:831)
java.lang.RuntimeException: expected[1] != actual[4]
	at compiler.tiered.CompLevelsTest.checkLevel(CompLevelsTest.java:76)
	at compiler.tiered.TieredLevelsTest.checkLevel(TieredLevelsTest.java:97)
	at compiler.tiered.CompLevelsTest.testAvailableLevel(CompLevelsTest.java:52)
	at compiler.tiered.TieredLevelsTest.test(TieredLevelsTest.java:77)
	at compiler.whitebox.CompilerWhiteBoxTest.runTest(CompilerWhiteBoxTest.java:176)
	at compiler.whitebox.CompilerWhiteBoxTest.main(CompilerWhiteBoxTest.java:135)
	at compiler.tiered.TieredLevelsTest.main(TieredLevelsTest.java:49)
	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:569)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:831)


To run with Graal as JIT use flags "-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+TieredCompilation -XX:+UseJVMCICompiler -Djvmci.Compiler=graal"


affected tests:
compiler/tiered/NonTieredLevelsTest.java
compiler/tiered/TieredLevelsTest.java
compiler/whitebox/DeoptimizeAllTest.java
compiler/intrinsics/mathexact/sanity/*
Comments
Here are CompileJVMCIMethods flag preliminary changes: http://cr.openjdk.java.net/~kvn/8202124/webrev.00/
04-07-2018

I am suggesting to defer this bug to JDK 12. I implemented diagnostic CompileJVMCIMethods flag but even with it some tests still fail because they switched off TieredCompilation: compiler/tiered/NonTieredLevelsTest.java compiler/whitebox/ForceNMethodSweepTest.java compiler/whitebox/IsMethodCompilableTest.java Adding +EagerJVMCI did not help. Also compiling JVMCI+Graal methods even when CompileOnly is specified is concern me because it could be not expected behavior. These tests are on Problem lists and adding @requires !vm.graal.enabled don't change much. The only real solution is to use libgraal which we will have in near future.
04-07-2018

whitebox/DeoptimizeFramesTest.java test has the same issues with Graal. See JDK-8204586.
04-07-2018

Or we can wait until jdk 12/13 when SVM libgraal is available.
03-07-2018

Note, some failing tests switch off -TieredCompilation in addition to CompileOnly command. Even allowing Graal method compilation (I tested) is not enough when TieredCompilation is off because Graal will have to compile itself before it can finish requested method compilation. I see that we added +EagerJVMCI to ForceNMethodSweepTest.java test and it still does not help. I think we should exclude tests with -XX:-TieredCompilation -XX:CompileCommand=compileonly from runs with Graal - add @requires !vm.graal.enabled
03-07-2018

> On Jun 21, 2018, at 4:29 PM, Vladimir Kozlov >> On 6/21/18 2:57 PM, Igor Ignatyev >>> On Jun 21, 2018, at 12:49 PM, Vladimir Kozlov >>> We can't run test which use CompileOnly and expect that Graal will compile specified methods in time. We can add Graal's and JVMCI's methods to CompileOnly list. Or we should make general exception for Graal's and JVMCI's methods. >> adding these methods to CompileOnly list in each test doesn't sound like a right thing to do, and making general exception for Graal's and JVMCI's methods doesn't either as it will make it impossible/harder to exclude graal/jvmci methods from compilation should it be necessary. adding a special diagnostic-only flag to keep graal/jvmci methods compilable regardless compileOnly might be a good enough compromise. > Good idea. I agree with diagnostic flag.
21-06-2018

Test has -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* command which prevent compilation of Graal methods. And as result: Warning: private compiler.whitebox.SimpleTestCaseHelper(int) is still in queue after 11290ms I think all tests which use compileonly command should be modified to allow Graal methods compilations. Or we should change 'compileonly' policy to apply only to not Graal and not JVMCI methods.
21-06-2018

JDK-8205490 adds compiler/intrinsics/mathexact/sanity/* tests to the problem list, if someone notices other tests failing due to a similar reason, please file a separate bug for them; if other bugs are closed a dup of this one, corresponding tests should be added to the problem list.
21-06-2018

Please note 8204265 was closed as duplicate of this 8202124. Also bumping this bug to P3 based on comments. Please edit if required. Thanks
08-06-2018

because it wasn't tier2 failure till today
25-04-2018

Why is a tier 2 failure ranked as a P4?
25-04-2018

I think the same issue is with compiler/whitebox/DeoptimizeAllTest.java Graal is too slow to compile ib > STDOUT: jib > CompileCommand: compileonly compiler/whitebox/SimpleTestCaseHelper.* jib > TEST CASE:CONSTRUCTOR_TEST jib > at test's start: jib > jib > private compiler.whitebox.SimpleTestCaseHelper(int): jib > compilable: true jib > compiled: false jib > comp_level: 0 jib > osr_compilable: true jib > osr_compiled: false jib > osr_comp_level: 0 jib > in_queue: false jib > compile_queues_size: 0 jib > jib > on exception 'private compiler.whitebox.SimpleTestCaseHelper(int) must not be compiled': jib > private compiler.whitebox.SimpleTestCaseHelper(int): jib > compilable: true jib > compiled: true jib > compile_id: 63 jib > comp_level: 4 jib > osr_compilable: true jib > osr_compiled: false jib > osr_comp_level: 0 jib > in_queue: false jib > compile_queues_size: 0 jib > jib > STDERR: jib > Warning: private compiler.whitebox.SimpleTestCaseHelper(int) is still in queue after 11303ms jib > java.lang.RuntimeException: private compiler.whitebox.SimpleTestCaseHelper(int) must not be compiled jib > at compiler.whitebox.CompilerWhiteBoxTest.checkNotCompiled(CompilerWhiteBoxTest.java:239) jib > at compiler.whitebox.CompilerWhiteBoxTest.checkNotCompiled(CompilerWhiteBoxTest.java:222) jib > at compiler.whitebox.DeoptimizeAllTest.test(DeoptimizeAllTest.java:68) jib > at compiler.whitebox.CompilerWhiteBoxTest.runTest(CompilerWhiteBoxTest.java:176) jib > at compiler.whitebox.CompilerWhiteBoxTest.main(CompilerWhiteBoxTest.java:135) jib > at compiler.whitebox.DeoptimizeAllTest.main(DeoptimizeAllTest.java:45)
25-04-2018

Similar issue with compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java: ava.lang.RuntimeException: Test bug, expected compilation (level): 4, but not compiled at compiler.intrinsics.mathexact.sanity.IntrinsicBase.checkCompilation(IntrinsicBase.java:100) at compiler.intrinsics.mathexact.sanity.IntrinsicBase.compileAtLevel(IntrinsicBase.java:95) at compiler.intrinsics.mathexact.sanity.IntrinsicBase.test(IntrinsicBase.java:59) at compiler.intrinsics.mathexact.sanity.SubtractExactLongTest.main(SubtractExactLongTest.java:50) 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:569) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115) at java.base/java.lang.Thread.run(Thread.java:831)
25-04-2018

Similar test failures compiler/tiered/NonTieredLevelsTest.java fails when running in Graal JIT mode: Warning: private compiler.whitebox.SimpleTestCaseHelper(int) is still in queue after 10819ms java.lang.RuntimeException: expected[4] != actual[0] at compiler.tiered.CompLevelsTest.checkLevel(CompLevelsTest.java:76) at compiler.tiered.NonTieredLevelsTest.test(NonTieredLevelsTest.java:84) at compiler.whitebox.CompilerWhiteBoxTest.runTest(CompilerWhiteBoxTest.java:176) at compiler.whitebox.CompilerWhiteBoxTest.main(CompilerWhiteBoxTest.java:135) at compiler.tiered.NonTieredLevelsTest.main(NonTieredLevelsTest.java:65) 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:569) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115) at java.base/java.lang.Thread.run(Thread.java:831) The issue is intermittent but is seen from time to time. To run the test: > jtreg -jdk:build/linux-x64/images/jdk -vmoptions:"-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+TieredCompilation -XX:+UseJVMCICompiler -Djvmci.Compiler=graal" -dir:test/hotspot/jtreg compiler/tiered/NonTieredLevelsTest.java
25-04-2018

As I remember I tried EagerJVMCI and it doesn't help.
25-04-2018

Hi [~epavlova], Assigning this as a testbug to you for now. (can this be adding related to adding EagerJVMCI flag for the test!) Please un-assign yourself or re-assign if required, Thanks.
24-04-2018

ILW = Single TieredLevelsTest test failure because compilation of SimpleTestCaseHelper is delayed!; intermittent, only with Graal; none = MLH = P4 (Can the fix here be adding EagerJVMCI flag fro the test ?)
24-04-2018