onionshare / onionshare-android

Android version of OnionShare

Home Page:https://onionshare.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConcurrentModificationException: TorControlConnection.handleEvent

grote opened this issue · comments

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)

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.

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.

Fixed by #21.