[Soot-list] ConcurrentModificationException when invoking getMethods()

Jan Peter Stotz jan-peter.stotz at sit.fraunhofer.de
Mon May 6 14:17:03 EDT 2019


Hi Fang,

you have enabled the option "allow_phantom_refs" and it looks like the 
code you are analyzing contains references to non-existent methods in 
the same class. In such a case soot automatically adds these method(s) 
as phantom methods once it encounters such a method reference.
This is the reason why you are getting this 
ConcurrentModificationException while iterating through the methods.

To avoid this kind of error create a copy of the method list (e.g. into 
an ArrayList) before iterating it.

Jan

Am 06.05.2019 um 20:09 schrieb Fang Zhou:
> Hi all,
> 
> I am trying to get all functions' arguments with soot. However, when I
> use getMethods() or iterator on the list of methods, I always get such
> error message:
> "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.SootClass$1.next(SootClass.java:505)
>          at soot.SootClass$1.next(SootClass.java:494)"
> 
> Why is the list of methods changed during my program since I do not
> run any analysis yet?


More information about the Soot-list mailing list