question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Concurrent Modification Exception in ScopeManager

See original GitHub issue

Hey, Im encountering a Concurrent Modification Exception caused by the ScopeManager if I get this right:

Caused by: java.util.ConcurrentModificationException
        at java.util.IdentityHashMap$IdentityHashMapIterator.nextIndex(IdentityHashMap.java:735) ~[?:?]
        at java.util.IdentityHashMap$EntryIterator.next(IdentityHashMap.java:843) ~[?:?]
        at java.util.IdentityHashMap$EntryIterator.next(IdentityHashMap.java:837) ~[?:?]
        at java.util.IdentityHashMap.putAll(IdentityHashMap.java:506) ~[?:?]
        at de.fraunhofer.aisec.cpg.passes.scopes.ScopeManager.mergeFrom(ScopeManager.kt:183) ~[cpg-core-master-SNAPSHOT.jar:?]
        at de.fraunhofer.aisec.cpg.TranslationManager.parseParallel(TranslationManager.kt:265) ~[cpg-core-master-SNAPSHOT.jar:?]
        at de.fraunhofer.aisec.cpg.TranslationManager.runFrontends(TranslationManager.kt:202) ~[cpg-core-master-SNAPSHOT.jar:?]
        at de.fraunhofer.aisec.cpg.TranslationManager.analyze$lambda-2(TranslationManager.kt:86) ~[cpg-core-master-SNAPSHOT.jar:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177) ~[?:?]

And here another related stack trace:

Caused by: java.util.ConcurrentModificationException
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042) ~[?:?]
        at java.util.ArrayList$Itr.next(ArrayList.java:996) ~[?:?]
        at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1047) ~[?:?]
        at de.fraunhofer.aisec.cpg.TranslationManager.runFrontends(TranslationManager.kt:415) ~[cpg-core-master-SNAPSHOT.jar:?]
        at de.fraunhofer.aisec.cpg.TranslationManager.analyze$lambda-2(TranslationManager.kt:86) ~[cpg-core-master-SNAPSHOT.jar:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177) ~[?:?]

Seems related to https://github.com/Fraunhofer-AISEC/cpg/issues/651 however this time, typeSystemActiveInFrontend is explicitly set to false .

Regards, Tom

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anon767commented, Jan 26, 2022

Hm I ran my program several times and the Exception is not appearing yet. So it may be fixed or I just havn’t encountered it yet

0reactions
oxistocommented, Jan 25, 2022

Doubtful, but this is an easy fix: #687. Can you try it with that branch? Maybe the other ones will disappear magically 😄 Yay that fixed it 😃

Does it fix the concurrent modification exceptions as well?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Avoid the Concurrent Modification Exception in Java
The ConcurrentModificationException in Java occurs when an object is attempted to be modified concurrently without permission.
Read more >
ConcurrentModificationException (Java Platform SE 7 )
This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.
Read more >
java.util.ConcurrentModificationException - DigitalOcean
ConcurrentModificationException is a very common exception when working with Java collection classes. Java Collection classes are fail-fast, ...
Read more >
Fix the ConcurrentModificationException | TechTarget
Java's ConcurrentModificationException is thrown when a collection is modified while a Java Iterator is trying to loop through it.
Read more >
ConcurrentModificationException in Java with Examples
If we invoke a sequence of methods on an object that violates its contract, then the object throws ConcurrentModificationException.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found