ConcurrentModificationException: TorControlConnection.handleEvent
grote opened this issue · comments
Torsten Grote commented
Samsung Galaxy S9+ Android 10 (SDK 29)
java.util.ConcurrentModificationException:
at java.util.ArrayList$Itr.next (ArrayList.java:860)
at net.freehaven.tor.control.TorControlConnection.handleEvent (TorControlConnection.java:239)
at net.freehaven.tor.control.TorControlConnection.react (TorControlConnection.java:382)
at net.freehaven.tor.control.TorControlConnection$ControlParseThread.run (TorControlConnection.java:352)
Torsten Grote commented
The line where the exception gets thrown is for (RawEventListener rawEventListener : rawEventListeners) {
.
Looks like we might be using addRawEventListener()
while the control connection is handling an event.
We should probably set the listeners before launching the control thread.
Torsten Grote commented
The real issue here seems to be that we are removing the event listener while still in that listener loop.
I don't really see another solution except just keeping that event listener attached.