JDK-8307091 : A few client tests intermittently throw ConcurrentModificationException
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 16,17,18,19,21
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_oracle
  • CPU: generic
  • Submitted: 2023-04-28
  • Updated: 2024-06-12
  • Resolved: 2023-05-04
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 11 JDK 17 JDK 21
11.0.25Fixed 17.0.13Fixed 21 b22Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Few of test using directory models threw ConcurrentModificationException Intermittently on Oracle Linux OCI.

java.util.ConcurrentModificationException
at java.base/java.util.AbstractList$SubList.checkForComodification(AbstractList.java:904)
at java.base/java.util.AbstractList$SubList.listIterator(AbstractList.java:835)
at java.base/java.util.AbstractList.listIterator(AbstractList.java:311)
at java.base/java.util.Collections$SynchronizedList.listIterator(Collections.java:2484)
at java.base/java.util.AbstractList.equals(AbstractList.java:544)
at java.base/java.util.Collections$SynchronizedList.equals(Collections.java:2453)
at java.desktop/javax.swing.plaf.basic.BasicDirectoryModel$FilesLoader$1.call(BasicDirectoryModel.java:358)
at java.desktop/javax.swing.plaf.basic.BasicDirectoryModel$FilesLoader$1.call(BasicDirectoryModel.java:336)
at java.desktop/sun.awt.shell.ShellFolderManager$DirectInvoker.invoke(ShellFolderManager.java:146)
at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:521)
at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:507)
at java.desktop/javax.swing.plaf.basic.BasicDirectoryModel$FilesLoader.run0(BasicDirectoryModel.java:336)
at java.desktop/javax.swing.plaf.basic.BasicDirectoryModel$FilesLoader.run(BasicDirectoryModel.java:289)
at java.base/java.lang.Thread.run(Thread.java:831)

JavaTest Message: Test threw exception: java.util.ConcurrentModificationException
JavaTest Message: shutting down test
Comments
Fix request [11u] I backport this for parity with 11.0.25-oracle. This backport is needed for JDK-8323670 to apply. Clean backport. SAP nightly testing passed.
12-06-2024

[jdk17u-fix-request] Approval Request from Martin This backport is needed for JDK-8323670 to apply. I guess that the backports were bundled in 17.0.13-oracle. Applies cleanly and tier 1-4 have passed.
07-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2551 Date: 2024-06-07 11:16:28 +0000
07-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2720 Date: 2024-05-23 06:13:56 +0000
23-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2489 Date: 2024-05-23 06:13:27 +0000
23-05-2024

This fix is superseded by JDK-8323670, it didn't resolve the problem.
30-01-2024

Changeset: 465bdd9e Author: Tejesh R <tr@openjdk.org> Date: 2023-05-04 04:52:00 +0000 URL: https://git.openjdk.org/jdk/commit/465bdd9e416cacc6cc7dd91a29cc84adf2eaf1ed
04-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13783 Date: 2023-05-03 16:13:53 +0000
03-05-2023

From the code analysis and few references from browsing, exception seems to be causing when local file cache vector is been compared with shared file cache vector. Even though vectors are thread safe, the comparison in turn calls for an iterator where the exception is occurring. As from the documents reference which states - "The iterators returned by this class's iterator and listIterator methods are fail-fast: if the vector is structurally modified at any time after the iterator is created, in any way except through the iterator's own remove or add methods, the iterator will throw a ConcurrentModificationException " Handling these scenarios will avoid causing the exception, since the issue is intermittent.
02-05-2023