Opened 3 months ago

Closed 3 months ago

#26568 closed defect (fixed)

--ControlPortWriteToFile reports port 0 on --ControlPort=auto, not opened port

Reported by: karalabe Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Major Keywords: regression, auto, control, port, invalid, empty, 034-must
Cc: Actual Points:
Parent ID: Points:
Reviewer: dgoulet Sponsor:

Description

If I start the latest tor code with --ControlPort=auto and --ControlPortWriteToFile=/path/to/file, then the contents of the file end up as PORT=127.0.0.1:0, which is kind of useless :)

I guess some code got messed up lately that updates the port before writing it out to the control file.

Child Tickets

Change History (10)

comment:1 Changed 3 months ago by teor

Keywords: regression? added
Milestone: Tor: 0.3.5.x-final
Version: Tor: unspecified

Hi, thanks for this bug report.
Which branch and commit are you using?

Questions for the developers:
Are we writing the file before we assign and open the control port?
Or did we change one of the control port functions in the refactor?

comment:2 Changed 3 months ago by teor

What was the last version that worked?
Does this issue happen with Tor 0.3.3 or Tor 0.3.4?

comment:3 Changed 3 months ago by karalabe

I have a fairly funky build setup, I pulled latest master where this issue was happening (not sure when it started, just started using Tor now). If I revert to latest stable (0.3.3.7), then everything works fine. Didn't test 0.3.4 as it conflicts with my builder.

comment:4 Changed 3 months ago by nickm

Keywords: regression added; regression? removed
Milestone: Tor: 0.3.5.x-finalTor: 0.3.4.x-final

I can confirm that 0.3.4 has this problem too, and 0.3.3 does not.

comment:5 Changed 3 months ago by nickm

Git bisect tells me that 6ed384b827dce21ea3a44b58792cc28b2ed48056 was the first bad commit.

comment:6 Changed 3 months ago by nickm

I think removing the gotPort field here was wrong.

comment:7 Changed 3 months ago by nickm

Keywords: 034-must added
Owner: set to nickm
Status: newaccepted

comment:8 Changed 3 months ago by nickm

Status: acceptedneeds_review

See branch bug26568_034 and PR at https://github.com/torproject/tor/pull/201

comment:9 Changed 3 months ago by dgoulet

Reviewer: dgoulet
Status: needs_reviewmerge_ready

working. lgtm;

comment:10 Changed 3 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged!

Note: See TracTickets for help on using tickets.