JDK-8323651 : compiler/c2/irTests/TestPrunedExHandler.java fails with -XX:+DeoptimizeALot
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22,23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-01-12
  • Updated: 2024-01-23
  • Resolved: 2024-01-16
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 22 JDK 23
22Fixed 23 b06Fixed
Related Reports
Relates :  
Description
This test fails intermittently when run with -XX:+DeoptimizeALot. Only noticed as the test runs with this option in the loom repo, it of course duplicates with main line too.

The typical failure is:

Custom Run Test: @Run: runNoTrapAfterDeoptInlined - @Test: testNoTrapAfterDeoptInlined:
compiler.lib.ir_framework.shared.TestRunException: There was an error while invoking @Run method public static void compiler.c2.irTests.TestPrunedExHandler.runNoTrapAfterDeoptInlined(compiler.lib.ir_framework.RunInfo)
	at compiler.lib.ir_framework.test.CustomRunTest.invokeTest(CustomRunTest.java:162)
	at compiler.lib.ir_framework.test.CustomRunTest.run(CustomRunTest.java:87)
	at compiler.lib.ir_framework.test.TestVM.runTests(TestVM.java:822)
	at compiler.lib.ir_framework.test.TestVM.start(TestVM.java:249)
	at compiler.lib.ir_framework.test.TestVM.main(TestVM.java:164)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at compiler.lib.ir_framework.test.CustomRunTest.invokeTest(CustomRunTest.java:157)
	... 4 more
Caused by: compiler.lib.ir_framework.shared.TestRunException: public static void compiler.c2.irTests.TestPrunedExHandler.testNoTrapAfterDeoptInlined(boolean) should have been deoptimized by C2
	at compiler.lib.ir_framework.shared.TestRun.check(TestRun.java:32)
	at compiler.lib.ir_framework.test.TestVM.assertDeoptimizedByC2(TestVM.java:906)
	at compiler.lib.ir_framework.TestFramework.assertDeoptimizedByC2(TestFramework.java:549)
	at compiler.c2.irTests.TestPrunedExHandler.runNoTrapAfterDeoptInlined(TestPrunedExHandler.java:138)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 6 more

	at compiler.lib.ir_framework.test.TestVM.runTests(TestVM.java:857)
	at compiler.lib.ir_framework.test.TestVM.start(TestVM.java:249)
	at compiler.lib.ir_framework.test.TestVM.main(TestVM.java:164)


Should this test be skipped when using this option, as in:
   @requires vm.opt.DeoptimizeALot != true
?
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk22/pull/82 Date: 2024-01-16 14:20:18 +0000
16-01-2024

Changeset: 2fd775f6 Author: Jorn Vernee <jvernee@openjdk.org> Date: 2024-01-16 13:25:49 +0000 URL: https://git.openjdk.org/jdk/commit/2fd775f69c8eb4d0bd1163e8b5d2615db105352b
16-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17432 Date: 2024-01-15 16:58:33 +0000
15-01-2024

This test can not work with -XX:+DeoptimizeALot It depends on a particular sequence of deoptimization, so if DeoptimizeALot deoptimizes prematurely, the test can fail. Should this test be skipped when using this option, as in: @requires vm.opt.DeoptimizeALot != true ? Yes, that seems like a good idea.
12-01-2024

Looks like a test bug to me. ILW = Test fails due to unexpected deopt state (probably test bug), single test with -XX:+DeoptimizeALot, no workaround = MLH = P4
12-01-2024

Jorn, could you please have a look?
12-01-2024