Opened 5 years ago

Last modified 4 years ago

#16220 new defect

Torbutton/Torlauncher flips out if TOR_SKIP_LAUCH is set without TOR_SOCKS_PORT

Reported by: yawning Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords:
Cc: mcs Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Might be kind of hard to test since I encountered this with some kind of sketchy alpha code I'm writing.

What I do:

  • Run my own control port implementation (basically a modified or-ctl-filter) on This implementation returns 250-net/listeners/socks=""\r\n250 OK\r\n in response to a GETINFO net/listeners/socks request.
  • Run my own SOCKS5 implementation on
  • Set TOR_SKIP_LAUNCH=1 (as the only Tor Browser env var).

What I expect to happen: Tor Browser should think that Tor is running.

What I get: The "Something went wrong" grey screen.

Setting TOR_SOCKS_PORT=9150 in the env var makes everything work, which puzzles me.

Child Tickets

Change History (3)

comment:1 Changed 5 years ago by yawning

A ha, I see what's happening but I'm not sure if it's correct.

mcs | The comparison is the address and port that was logged
    | vs. the values of these prefs:  network.proxy.socks and
    | network.proxy.socks_port

Since I usually have TOR_SOCKS_PORT=9050 as part of my environment, it's saved in my profile's config. I'm not sure something that's set as an env var should be persisted (as in, I'd expect the value displayed in about:config to reset back to the default if I unset the env var and relaunch Tor Browser).

If I go into about:config and reset network.proxy.socks_port, everything works as expected, till I launch Tor Browser with a custom port again (and it gets saved).

comment:2 Changed 5 years ago by mikeperry

This behavior will probably go away if we fix #15852. Torbutton thinks it is disabled because its stored socks port no longer matches network.proxy.socks_port. I think the right solution is to remove the code in Torbutton that performs this check, so we only have one place where socks settings are stored.

comment:3 Changed 4 years ago by mcs

Severity: Normal

Now that #15852 has been fixed, I took another look at this ticket. But it is not fixed because we kept the code in Torbutton that sets network.proxy.socks_port to 9050 when the browser is started with TOR_SOCKS_PORT=9050. So the control port check is correct: the proxy is misconfigured if you are really running it on 9150.

I do not know how to fix this without making the effect of the env vars temporary, which would be difficult to do in a way that is "bulletproof" (or crash-proof at least).

Note: See TracTickets for help on using tickets.