Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DexPrinter : Exception in thread "main" java.util.ConcurrentModificationException #1162

Closed
louison opened this issue Jun 4, 2019 · 1 comment

Comments

@louison
Copy link

louison commented Jun 4, 2019

Hi there, I'm currently experiencing a new error on multiple apks. These errors might be related to #999 and #1067.

This error comes up when trying to write apk classes using
PackManager.v().writeOutput(); with a loaded apk in Soot.

[Thread-20] ERROR heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: null
java.util.ConcurrentModificationException
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
	at java.util.ArrayList$Itr.next(ArrayList.java:859)
	at soot.toDex.DexPrinter.toMethods(DexPrinter.java:1077)
	at soot.toDex.DexPrinter.addAsClassDefItem(DexPrinter.java:656)
	at soot.toDex.DexPrinter.add(DexPrinter.java:1646)
	at soot.PackManager.writeClass(PackManager.java:1096)
	at soot.PackManager.lambda$writeOutput$1(PackManager.java:699)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-20" java.util.ConcurrentModificationException
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
	at java.util.ArrayList$Itr.next(ArrayList.java:859)
	at soot.toDex.DexPrinter.toMethods(DexPrinter.java:1077)
	at soot.toDex.DexPrinter.addAsClassDefItem(DexPrinter.java:656)
	at soot.toDex.DexPrinter.add(DexPrinter.java:1646)
	at soot.PackManager.writeClass(PackManager.java:1096)
	at soot.PackManager.lambda$writeOutput$1(PackManager.java:699)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "main" java.util.ConcurrentModificationException
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
	at java.util.ArrayList$Itr.next(ArrayList.java:859)
	at soot.toDex.DexPrinter.toMethods(DexPrinter.java:1077)
	at soot.toDex.DexPrinter.addAsClassDefItem(DexPrinter.java:656)
	at soot.toDex.DexPrinter.add(DexPrinter.java:1646)
	at soot.PackManager.writeClass(PackManager.java:1096)
	at soot.PackManager.lambda$writeOutput$1(PackManager.java:699)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

I think that the array of SootClass manipulated in the method DexPrinter.toMethod() might be modified when looping on it.

I don't know if it is directly related to Soot or to the Heroes lib.

Best,

Louison

@louison
Copy link
Author

louison commented Jun 4, 2019

Here is an apk sample on which I experience the sample :
https://transfer.sh/5YqIp/com.cookware.worldcusinerecipes.apk

I'm using Soot 3.3.0 release with the develop branch of FlowDroid.

Please tell me if this issue should move to another repo such as FlowDroid or Heroes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant