Opened 9 years ago

Closed 9 years ago

#4048 closed defect (fixed)

If Tor leaves behind its port.conf file, Vidalia and Tor race at next startup

Reported by: arma Owned by: chiiph
Priority: Medium Milestone:
Component: Archived/Vidalia Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If your Tor dies in an unclean way, its port.conf file stays around. Then the next time you run TBB, Vidalia says "is there a port.conf file? Why yes there is", and then reads it and uses the wrong ports.

Some users, e.g. on OS X, have reported this happening in practice.

Sometimes it works, since Tor writes a new one before Vidalia checks.

Child Tickets

Change History (7)

comment:1 Changed 9 years ago by arma

One solution would be for some component of TBB to rm the file before starting Tor. Then there wouldn't be a race anymore.

What's the right component to be doing it? The startup script? Vidalia?

comment:2 Changed 9 years ago by erinn

TBB could do it, but TBB's start up scripts (except for Linux) are a little bit hacky and all different. It won't be elegant. But it may be the easiest.

Then again, doesn't this behavior also exist in situations where you have not actually killed TBB but merely stopped and restarted tor? In that case, TBB startup scripts are the wrong place and Vidalia or Tor will be smarter. I think.

comment:3 in reply to:  2 Changed 9 years ago by arma

Replying to erinn:

Then again, doesn't this behavior also exist in situations where you have not actually killed TBB but merely stopped and restarted tor? In that case, TBB startup scripts are the wrong place and Vidalia or Tor will be smarter. I think.

If you use TBB's Vidalia to click 'stop tor' and 'start tor', then Tor will pick a new set of auto ports, and the Firefox that's already running will now be pointing to the wrong ports. I think that's a separate bug, and the fix for it is for Vidalia to memorize the ports it told Firefox and tell them to Tor if it ever finds itself starting Tor again. Did I file a bug for this one and forget about it, or should I do that?

comment:4 in reply to:  2 Changed 9 years ago by arma

Replying to erinn:

In that case, TBB startup scripts are the wrong place and Vidalia or Tor will be smarter. I think.

I agree that having Vidalia do it is best. Vidalia knows what datadir it is configured to think Tor will use, after all, and it already knows how to construct the path to the port.conf file, since it is planning to try to read it once it launches Tor.

comment:5 Changed 9 years ago by mikeperry

I hit these same symptoms after an X crash, but it was really #3462 (my Tor was still running after TBB exit).

However, once I force-killed my tor, I hit this bug :)

comment:6 Changed 9 years ago by arma

Component: Tor bundles/installationVidalia
Owner: changed from erinn to chiiph

Reassigning this bug to the Vidalia component then, so it gets some love from chiiph.

Basically, if Vidalia plans to be reading the port.conf file after starting Tor, should try to unlink the file before it starts Tor.

It sounds like a bugfix rather than new feature, which should eventually find its way into a Vidalia 0.2.x stable release.

comment:7 Changed 9 years ago by chiiph

Resolution: fixed
Status: newclosed

This is fixed in my branch chiiph/bug4048_unlinkportconf for alpha and chiiph/bug4048_unlinkportconf_backport for stable. It'll go out with 0.3.1-alpha and 0.2.16.

Note: See TracTickets for help on using tickets.