-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Progress bar when orbot is starting gets stuck sometimes #621
Comments
Also, I see this in the logcat if I let Orbot sit a few mins when the notification is stuck:
|
I actually spent a good deal of time looking into this today, here's what I know so far: Tor doesn't just appear to be connected, but it actually is - going to check.torproject.org works and all that. The specific message you quoted: "Connected to tor control port" happens in the method private void initControlConnection() {
if (conn != null) {
logNotice(getString(R.string.log_notice_connected_to_tor_control_port));
try {
String confSocks = conn.getInfo("net/listeners/socks");
StringTokenizer st = new StringTokenizer(confSocks, " ");
confSocks = st.nextToken().split(":")[1];
confSocks = confSocks.substring(0, confSocks.length() - 1);
mPortSOCKS = Integer.parseInt(confSocks);
String confHttp = conn.getInfo("net/listeners/httptunnel");
st = new StringTokenizer(confHttp, " ");
confHttp = st.nextToken().split(":")[1];
confHttp = confHttp.substring(0, confHttp.length() - 1);
mPortHTTP = Integer.parseInt(confHttp);
String confDns = conn.getInfo("net/listeners/dns");
st = new StringTokenizer(confDns, " ");
if (st.hasMoreTokens()) {
confDns = st.nextToken().split(":")[1];
confDns = confDns.substring(0, confDns.length() - 1);
mPortDns = Integer.parseInt(confDns);
Prefs.getSharedPrefs(getApplicationContext()).edit().putInt(PREFS_DNS_PORT, mPortDns).apply();
}
String confTrans = conn.getInfo("net/listeners/trans");
st = new StringTokenizer(confTrans, " ");
if (st.hasMoreTokens()) {
confTrans = st.nextToken().split(":")[1];
confTrans = confTrans.substring(0, confTrans.length() - 1);
mPortTrans = Integer.parseInt(confTrans);
}
sendCallbackPorts(mPortSOCKS, mPortHTTP, mPortDns, mPortTrans);
} catch (IOException e) {
e.printStackTrace();
stopTorOnError(e.getLocalizedMessage());
conn = null;
}
}
} Earlier I spent a lot of time sprinkling a lot of Log statements into OrbotService and rebooting my device in order to try and get this error. I've noticed that when this error occurs |
We listen to the tor controller's "BW" event by way of subscribing to the This event acts as a heartbeat. Every second or so in fires off the bandwidth, and when Orbot works as it should, it replaces the progress bar with the bandwidth stats and a text string that says Tor is Connected. Notably when this error occurs, this event is not firing |
Under some (race) condition(s) the tor control connection is lost, basically 🤷♀️ I'll post more here when I find out more ... @syphyr if you come up with any way to reliably reproduce this bug that'd be a huge lifesaver. |
My theory right now is that Orbot's UI gets connected to tor because this /**
* Announce Tor is available for connections once the first circuit is complete
*/
private final RawEventListener startedEventListener = new RawEventListener() {
@Override
public void onEvent(String keyword, String data) {
if (TorService.STATUS_STARTING.equals(TorService.currentStatus)
&& TorControlCommands.EVENT_CIRCUIT_STATUS.equals(keyword)
&& data != null && data.length() > 0) {
String[] tokenArray = data.split(" ");
if (tokenArray.length > 1 && TorControlCommands.CIRC_EVENT_BUILT.equals(tokenArray[1])) {
TorService.broadcastStatus(TorService.this, TorService.STATUS_ON);
}
}
}
}; However, for some reason, the one in |
I can usually reproduce this issue by the following steps:
Using an older/slower android device might make this easier to reproduce since the race condition seems to occur when repeatedly starting and stopping the Orbot application (not just starting and stopping the Tor service within Orbot). Perhaps the application is not starting up fast enough to sync with the Tor service. This race condition between Orbot and Tor is a very old issue because I can also reproduce it with Orbot 16.0.1. I did notice that when the notification bar is stuck on "Starting Orbot...", Orbot's UI says the Tor is connected. Why does Orbot's UI message not get stuck at "Starting Orbot" like the notification bar does? |
Ah, have not read this before, seems I have the same issue on 2 phones here with 16.6.0 rc3. Edit: |
@eighthave while ((conn = torService.getTorControlConnection()) == null) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
Log.e("bim", e.getLocalizedMessage());
}
} I haven't gotten into debugging it yet, but it seems like somehow |
@eighthave, specifically if (runLock.isLocked()) {
Log.i(TAG, "Waiting for lock");
}
runLock.lock(); I'm usually able to reproduce this by starting Orbot and then immediately closing and returning to the home screen. |
Isn't there an issue about this lock on the tor-android tracker? I think it
will require someone digging into it to debug.
|
Yes, this one. In the comments I've suggested some possible causes and fixes. |
It is, I didn't initially realize that this Orbot UI issue was related on tor-android |
Still struggling on this and loosing connections with 16.6.1RC1...sorry but in current state Orbot is almost unusable / a security threat - it is able to "fix" its issues temporarily by disabling/reenabling Vpn-connection - but I assume apps try to connect while disabling this in Orbot, so its not the safest way to handle. Whatever is causing these problems, please invest ALL your efforts in fixing these stability-problems....users need a stable and safe app, especially when its security relevant. |
…occur, basically Orbot set tor events and then TorService set its own CIRC event which caused the Orbot UI to not update
The progress bar when Orbot starts up often gets stuck with a message saying "starting orbot". This happens very often if Orbot is chosen start up at boot. But, this also occurs often when just starting and stopping Orbot.
In OrbotService.java, it looks like the status bar is waiting for a LOG_NOTICE_BOOTSTRAPPED, but the issue is that often Orbot's log does not contain this message after Orbot starts up. For example, when starting and stopping Orbot, the log message often gets truncated for some reason.
The text was updated successfully, but these errors were encountered: