Opened 5 years ago

Closed 19 months ago

#13920 closed defect (duplicate)

If the ports tor wants to use are already in use, try different ports before freaking out.

Reported by: StrangeCharm Owned by: brade
Priority: Low Milestone:
Component: Applications/Tor Launcher Version:
Severity: Normal Keywords:
Cc: mcs Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

A user story:
Imagine that you want to run two instances of Torbrowser at the same time. Perhaps you want to use one site in one instance and another site with the other, but who knows? You download the Torbrowser tarball and extract it twice — into two different directories. Now you launch one of the Torbrowsers. So far so good. You go to launch the other one, and… oh no, “Tor unexpectedly exited.”. Now you're sad.

Tor didn't launch properly because the ports it wants to use are already in use by the other Torbrowser's tor. You could fiddle with the config files to manually fix this. But it'd be nicer if Tor Launcher figured this out on its own. If tor didn't start properly, was it because the ports it wanted were already in use? If we just increment them all by one and try again, does it work? If so, let's just do that.

Child Tickets

Change History (9)

comment:1 Changed 5 years ago by mcs

Cc: mcs added

comment:2 Changed 5 years ago by StrangeCharm

A possible solution is using tor's auto port option to pick a port that works and write that to a file. Then Tor Launcher just needs to try reading that file and binding to that tor.

Apparently this is problematic on Windows though because some Windows firewalls assume that anything which tries to get a port the way tor does with auto is malware. Still, that shouldn't be a worry for other platforms.

comment:3 Changed 5 years ago by mcs

Support for SocksPort auto requires that Tor Launcher have some way to determine what TCP port was actually chosen by tor. Does the "write the port to a file" feature exist in tor? Or would Tor Launcher need to get that info from the tor log? We will need to do some research.

Related tickets: #3511 and #3948.

comment:4 in reply to:  3 Changed 5 years ago by mcs

Replying to mcs:

Support for SocksPort auto requires that Tor Launcher have some way to determine what TCP port was actually chosen by tor. Does the "write the port to a file" feature exist in tor? Or would Tor Launcher need to get that info from the tor log? We will need to do some research.

What I wrote is slightly misleading. The real issue is for Tor Launcher to be able to determine the control port chosen when ControlPort auto is used.

comment:5 Changed 5 years ago by StrangeCharm

Tor can write the control port to a file with ControlPortWriteToFile. Once Tor Launcher knows the control port, can it ask tor what the SOCKS port is?

comment:6 in reply to:  5 Changed 5 years ago by arma

Replying to StrangeCharm:

Tor can write the control port to a file with ControlPortWriteToFile. Once Tor Launcher knows the control port, can it ask tor what the SOCKS port is?

Yes, exactly so.

comment:7 Changed 23 months ago by teor

Severity: Normal

Set all open tickets without a severity to "Normal"

comment:8 Changed 19 months ago by mcs

This is a duplicate of #10439.

Last edited 19 months ago by mcs (previous) (diff)

comment:9 Changed 19 months ago by mcs

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.