JDK-8229253 : forkjoin/FJExceptionTableLeak.java fails "AssertionError: failed to satisfy condition"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Affected Version: 14,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-08-07
  • Updated: 2024-06-11
  • Resolved: 2021-01-09
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 b05Fixed
Related Reports
Relates :  
Relates :  
Description
The following test is failing in the jdk/jdk CI:

java/util/concurrent/forkjoin/FJExceptionTableLeak.java

Here's a snippet from the log file:

----------System.out:(40/2445)----------
[TestNG] Running:
  java/util/concurrent/forkjoin/FJExceptionTableLeak.java

test FJExceptionTableLeak.exceptionTableCleanup(): failure
java.lang.AssertionError: failed to satisfy condition
	at FJExceptionTableLeak.gcAwait(FJExceptionTableLeak.java:202)
	at FJExceptionTableLeak.exceptionTableCleanup(FJExceptionTableLeak.java:137)
	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:567)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:773)
	at org.testng.TestRunner.run(TestRunner.java:623)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
	at org.testng.TestNG.run(TestNG.java:1018)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
	at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:830)

===============================================
java/util/concurrent/forkjoin/FJExceptionTableLeak.java
Total tests run: 1, Failures: 1, Skips: 0
===============================================

----------System.err:(11/604)----------
java.lang.Exception: failures: 1
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96)
	at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:830)

JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 1


test result: Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 1
Comments
The jdk11u-dev GHA test runner report the same failure: https://github.com/sendaoYan/jdk11u-dev-ysd/actions/runs/9462255024/job/26066939940
11-06-2024

Changeset: 5cfa8c94 Author: Martin Buchholz <martin@openjdk.org> Date: 2021-01-09 20:57:52 +0000 URL: https://git.openjdk.java.net/jdk/commit/5cfa8c94
09-01-2021

Root cause still not understood, but will be fixed by integration for ForkJoin updates
08-01-2021

Here's a snippet from the log file for the jdk-16+32-2166-tier6 sighting: java/util/concurrent/forkjoin/FJExceptionTableLeak.java ----------System.out:(41/2555)---------- [TestNG] Running: java/util/concurrent/forkjoin/FJExceptionTableLeak.java test FJExceptionTableLeak.exceptionTableCleanup(): failure java.lang.AssertionError: failed to satisfy condition at FJExceptionTableLeak.gcAwait(FJExceptionTableLeak.java:202) at FJExceptionTableLeak.exceptionTableCleanup(FJExceptionTableLeak.java:137) 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:567) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) 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:567) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) at java.base/java.lang.Thread.run(Thread.java:831) =============================================== java/util/concurrent/forkjoin/FJExceptionTableLeak.java Total tests run: 1, Failures: 1, Skips: 0 =============================================== ----------System.err:(12/714)---------- java.lang.Exception: failures: 1 at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96) 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:567) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) at java.base/java.lang.Thread.run(Thread.java:831) JavaTest Message: Test threw exception: java.lang.Exception JavaTest Message: shutting down test result: Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 1
08-01-2021

The exception table is going away in the next fork-join jsr166 integration, which should resolve the failure (but there may be a very rare hotspot bug being demonstrated by this failure).
26-06-2020

It might be helpful to report information about the retained FailingTaskException count, to see if none are being collected or whether it is a partial collection.
26-06-2020

Bumping from P4 -> P3 since this failure mode has appeared in a Tier1 job set. Still very intermittent though.
26-06-2020

Last few days we're seeing this test fail about 1 per million times, with the product JDK and default flags. I also tried to stress test fastdebug JDK with the flags Daniel provided but that just made the test slower, not more reproducible. I'm suspecting a gc or jit bug that results in a strong reference being retained somewhere, e.g. on the stack after OSR. But too hard to hunt down!
14-08-2019

Thanks Martin, Doug, It's been suggested that maybe the combination of `-Xcomp` and `-XX:+DeoptimizeALot` might have starved the GC threads preventing it to complete in the imparted time, or maybe that particular machine was overloaded, or.... I have no idea whether that's what happened here. We should probably just keep an eye for similar failures and wait and see if it ever reproduces again before trying anything. If after a while we haven't seen any new failure we can probably close it as `not reproducible`.
12-08-2019

BTW, this test will need to adapt to upcoming version of FJT that no longer uses an exceptionTable (so cannot leak). In the mean time though, we cannot diagnose this failure.
11-08-2019

As usual, we can't repro this failure in our own stress tests. This test already goes to great lengths to give the VM multiple chances to do its stuff. It might help if you could narrow down the failure provoking flags. Multiple runs per repro will be required.
11-08-2019

The test was run with a fastdebug build and the following options: -Dtest.vm.opts='-Xmx512m -XX:MaxRAMPercentage=6 -ea -esa' \\ -Dtest.tool.vm.opts='-J-Xmx512m -J-XX:MaxRAMPercentage=6 -J-ea -J-esa' \\ -Dtest.compiler.opts= \\ -Dtest.java.opts='-Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot' \\ -Dtest.timeout.factor=16.0 \\ The fastdebug + -Xcomp combination has been known to upset timeouts before - maybe the timeout factor should be taken into account in the test code to extend the timeout in gcAwait?
08-08-2019