JDK-8261247 : some compiler/whitebox/ tests fail w/ DeoptimizeALot
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2021-02-05
  • Updated: 2021-04-27
  • Resolved: 2021-03-06
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 b13Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
The following test failed in the JDK17 CI:

compiler/whitebox/ClearMethodStateTest.java

Here's a snippet from the log file:

TEST CASE:OSR_CONSTRUCTOR_TEST
at test's start:

private compiler.whitebox.SimpleTestCaseHelper(java.lang.Object,long) throws java.lang.Exception:
	compilable:	true
	compiled:	false
	comp_level:	0
	osr_compilable:	true
	osr_compiled:	false
	osr_comp_level:	0
	in_queue:	false
compile_queues_size:	83

    882  290             java.util.regex.Matcher::reset (128 bytes)
    896  296    b        compiler.whitebox.SimpleTestCaseHelper::method (3 bytes)
    897  294 %           java.util.regex.Matcher::search @ 46 (154 bytes)
   2295  297     n       java.lang.invoke.MethodHandle::linkToStatic(LJL)L (native)   (static)
   2296  299     n       java.lang.invoke.MethodHandle::invokeBasic(LJ)L (native)   
   2308  300     n       java.lang.invoke.MethodHandle::linkToSpecial(LLJL)L (native)   (static)
   2330  304     n       java.lang.invoke.MethodHandle::linkToStatic(JLLLL)J (native)   (static)
   2333  305     n       java.lang.invoke.MethodHandle::invokeBasic(JLLL)J (native)   
   2338  306     n       java.lang.invoke.MethodHandle::linkToSpecial(LJLLLL)J (native)   (static)
   2342  309     n       java.lang.invoke.MethodHandle::invokeBasic(JLL)J (native)   
   2342  310     n       java.lang.invoke.MethodHandle::linkToSpecial(LJLLL)J (native)   (static)
   2352  314     n       java.lang.invoke.MethodHandle::invokeBasic(J)L (native)   
   2352  315     n       java.lang.invoke.MethodHandle::linkToSpecial(LJL)L (native)   (static)
   2356  318     n       java.lang.invoke.MethodHandle::linkToStatic(JLL)J (native)   (static)
   2356  319     n       java.lang.invoke.MethodHandle::invokeBasic(JL)J (native)   
   2357  320     n       java.lang.invoke.MethodHandle::linkToSpecial(LJLL)J (native)   (static)
   2358  321     n       java.lang.invoke.MethodHandle::linkToStatic(LLLLLLLL)L (native)   (static)
   2360  322     n       java.lang.invoke.MethodHandle::invokeBasic(LLLLLLL)L (native)   
   2364  323     n       java.lang.invoke.MethodHandle::linkToStatic(LLLJL)L (native)   (static)
   2366  325     n       java.lang.invoke.MethodHandle::invokeBasic(LLLJ)L (native)   
   2368  327     n       java.lang.invoke.MethodHandle::linkToStatic(LLLLLLLLL)L (native)   (static)
   2370  330     n       java.lang.invoke.MethodHandle::invokeBasic(L)J (native)   
   2370  331     n       java.lang.invoke.MethodHandle::linkToSpecial(LLL)J (native)   (static)
   2372  332     n       java.lang.invoke.MethodHandle::invokeBasic(LLLLLLLL)L (native)   
   2375  334     n       java.lang.invoke.MethodHandle::linkToStatic(LLLLLLLLLL)L (native)   (static)
   2380  336     n       java.lang.invoke.MethodHandle::invokeBasic(LLLLLLLLL)L (native)   
on exception 'private compiler.whitebox.SimpleTestCaseHelper(java.lang.Object,long) throws java.lang.Exception must be osr_compiled':
private compiler.whitebox.SimpleTestCaseHelper(java.lang.Object,long) throws java.lang.Exception:
	compilable:	true
	compiled:	false
	comp_level:	0
	osr_compilable:	true
	osr_compiled:	false
	osr_comp_level:	0
	in_queue:	false
compile_queues_size:	104

----------System.err:(29/2495)----------
java.lang.RuntimeException: private compiler.whitebox.SimpleTestCaseHelper(java.lang.Object,long) throws java.lang.Exception must be osr_compiled
	at compiler.whitebox.CompilerWhiteBoxTest.checkCompiled(CompilerWhiteBoxTest.java:258)
	at compiler.whitebox.ClearMethodStateTest.test(ClearMethodStateTest.java:76)
	at compiler.whitebox.CompilerWhiteBoxTest.runTest(CompilerWhiteBoxTest.java:170)
	at compiler.whitebox.CompilerWhiteBoxTest.main(CompilerWhiteBoxTest.java:129)
	at compiler.whitebox.ClearMethodStateTest.main(ClearMethodStateTest.java:50)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:831)
java.lang.RuntimeException: private compiler.whitebox.SimpleTestCaseHelper(java.lang.Object,long) throws java.lang.Exception must be osr_compiled
	at compiler.whitebox.CompilerWhiteBoxTest.checkCompiled(CompilerWhiteBoxTest.java:258)
	at compiler.whitebox.ClearMethodStateTest.test(ClearMethodStateTest.java:76)
	at compiler.whitebox.CompilerWhiteBoxTest.runTest(CompilerWhiteBoxTest.java:170)
	at compiler.whitebox.CompilerWhiteBoxTest.main(CompilerWhiteBoxTest.java:129)
	at compiler.whitebox.ClearMethodStateTest.main(ClearMethodStateTest.java:50)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:831)

JavaTest Message: Test threw exception: java.lang.RuntimeException: private compiler.whitebox.SimpleTestCaseHelper(java.lang.Object,long) throws java.lang.Exception must be osr_compiled
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: private compiler.whitebox.SimpleTestCaseHelper(java.lang.Object,long) throws java.lang.Exception must be osr_compiled
----------rerun:(53/8552)*----------
Comments
Changeset: 3844ce40 Author: Igor Ignatyev <iignatyev@openjdk.org> Date: 2021-03-06 21:08:20 +0000 URL: https://git.openjdk.java.net/jdk/commit/3844ce40
06-03-2021

[~iignatyev] You definitely know better how to do that. I'll assign this one to you. Thanks! It should probably be done for all the tests that use WB and test whether a method is compiled.
09-02-2021

yup, it would seem that the assumptions of this test don't hold w/ +DeoptimizeALot, and as the main purpose of compiler/whitebox/ClearMethodStateTest is to test WhiteBox functions, so I'm completely fine w/ removing it from runs +DeoptimizeALot. [~iveresov], will you add @requries yourself, or do you want me to take care of it?
08-02-2021

I really doubt these tests are supposed to behave stably with DeoptimizeALot. The test method that the test intends to compile (SimpleTestCaseHelper::osrMethod()) has a loop, which would probably end up having a safepoint, in which it can deopt and then it wouldn't be considered as compiled anymore. [~iignatyev], what do you think? Should we avoid running these tests with DeoptimizeALot ?
08-02-2021

Most likely related to JDK-8251462.
08-02-2021

[~iveresov] please, look.
05-02-2021

This is similar to the followig Graal bug: JDK-8181831 [Graal] compiler/whitebox tests fail to trigger OSR compilation but the test tasks JVM args are: -Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:+DeoptimizeALot so Graal is not involved here.
05-02-2021