Opened 6 years ago

Closed 6 years ago

#8444 closed defect (duplicate)

"LearnCircuitBuildTimeout 0" is broken when no CircuitBuildTimeout is set

Reported by: aagbsn Owned by: hellais, naif
Priority: High Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version: Tor: 0.2.3.25
Severity: Keywords: tor-client tor2web
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Tor, when compiled with --enable-tor2web-mode and a torrc with Tor2webMode enabled has trouble establishing a directory connection.

Steps to reproduce: build Tor with --enable-tor2web-mode, set the Tor2webMode 1 option in torrc and start Tor.

Sometimes it hangs at 10% (Establishing directory connection), other times it hangs at 45% (Asking for relay descriptors)

Child Tickets

Change History (7)

comment:1 Changed 6 years ago by aagbsn

Whoops, the correct 10% message is "Finishing handshake with directory server"

comment:2 Changed 6 years ago by nickm

Keywords: tor-client tor2web added
Milestone: Tor: unspecified

Can you please use "git bisect" to figure out which commit broke this?

comment:3 Changed 6 years ago by aagbsn

will do. It looks like the Tor version on tor2web.org documentation is Tor 2.3.12-alpha, so I'll start from there...

comment:4 Changed 6 years ago by aagbsn

Tested with openssl-1.0.1e and libevent 2.0.18-stable
bisect log

git bisect start
# good: [800942b4176ca31cbdc03edb6469fd56d2e1acdc] add a release blurb for 0.2.3.12-alpha
git bisect good 800942b4176ca31cbdc03edb6469fd56d2e1acdc
# bad: [17c24b3118224d6536c41fa4e1493a831fb29f0a] bump to 0.2.3.25
git bisect bad 17c24b3118224d6536c41fa4e1493a831fb29f0a
# good: [fc5d960fbda217a301b4ec09d906992b74849c15] Merge remote-tracking branch 'public/bug5541_v2'
git bisect good fc5d960fbda217a301b4ec09d906992b74849c15
# bad: [0b3f5ca11f276841f498cf7164016682911a42bd] merge changes files into upcoming changelog
git bisect bad 0b3f5ca11f276841f498cf7164016682911a42bd
# good: [5a3d9636f5e0ead80a46163af9ffadcbf6d5195f] Merge remote-tracking branch 'public/bug3940_redux'
git bisect good 5a3d9636f5e0ead80a46163af9ffadcbf6d5195f
# bad: [8030ec4f272d470b9d01b7095f17252aaca163c2] Downgrade log messages about cbt enabled/disabled. Bug 6169.
git bisect bad 8030ec4f272d470b9d01b7095f17252aaca163c2
# bad: [aa284561c804085ab2bb3e414165fdeff9872d05] Move cbt->liveness.timeouts_after_firsthop free code into its own function
git bisect bad aa284561c804085ab2bb3e414165fdeff9872d05
# good: [37ef4f1689b51f2c78a1f02ec466b2fd34d11636] Change smartlist_create->smartlist_new in bug4744 branch as merged to master
git bisect good 37ef4f1689b51f2c78a1f02ec466b2fd34d11636
# good: [41a458ece1d61b7e3402ac0fe9c17d51c88e7068] Add debug logging to circuit_build_times_* of circuitbuild.c to trace queries of consensus parameters for bug 5049
git bisect good 41a458ece1d61b7e3402ac0fe9c17d51c88e7068
# bad: [a0f76289fd8b778dd6a46c8726fddfc15d68193d] Use K&R style
git bisect bad a0f76289fd8b778dd6a46c8726fddfc15d68193d
# bad: [7df26de948d478bd9d1d85ffb54ca81f9f7488f1] Unconditionally use config CircuitBuildTimeout if LearnCircuitBuildTimeout is disabled
git bisect bad 7df26de948d478bd9d1d85ffb54ca81f9f7488f1
# good: [5177ab9e4783c1ca9928ac70d19b7daaeacd6b93] Don't track circuit timeout history unless we're actually using adaptive timeouts
git bisect good 5177ab9e4783c1ca9928ac70d19b7daaeacd6b93

first bad commit

7df26de948d478bd9d1d85ffb54ca81f9f7488f1 is the first bad commit
commit 7df26de948d478bd9d1d85ffb54ca81f9f7488f1
Author: Andrea Shepard <andrea@persephoneslair.org>
Date:   Tue Jun 12 12:11:32 2012 -0700

    Unconditionally use config CircuitBuildTimeout if LearnCircuitBuildTimeout is disabled

comment:5 Changed 6 years ago by nickm

Milestone: Tor: unspecifiedTor: 0.2.3.x-final
Priority: normalmajor
Status: newneeds_review
Summary: Tor in tor2webmode hangs at 10% "Establishing Directory Connection""LearnCircuitBuildTimeout 0" is broken when no CircuitBuildTimeout is set

It looks to me like this will also affect anybody who has disabled LearnCircuitBuildTimeout but not set CircuitBuildTimout.

I think that the right fix is that circuit_build_times_get_initial_timeout() should check whether CircuitBuildTimeout is actually set, and if not, we should use a default value.

Try branch "bug8444_v1" in my public repository? If it works and it passes review, I'll add a changes file and a real commit message.

comment:6 Changed 6 years ago by rransom

Duplicate of #6304.

comment:7 Changed 6 years ago by nickm

Resolution: duplicate
Status: needs_reviewclosed

Good point. Closing as duplicate.

Note: See TracTickets for help on using tickets.