Bug#835119: tor client does not immediately open new circuits after standby

2016-08-24 Thread Viktor Jägersküpper
found 835119 0.2.8.2-alpha-1
thanks

I tested different versions again yesterday and today, this time only
0.2.7.6-1, 0.2.8.2-alpha-1 and 0.2.9.1-alpha-1 and I had several "long"
standby sessions. The results are again confusing, the 0.2.7 series
doesn't seem to have the issue, but it occurs in the 0.2.8 series and
also in the version 0.2.9.1-alpha-1 which also worked "normally" one
time, as you can see in the complete log of yesterday and today.
Aug 23 10:47:41.305 [notice] Tor v0.2.7.6 (git-605ae665009853bd) running on 
Linux with Libevent 2.0.21-stable, OpenSSL 1.0.2h and Zlib 1.2.8.
Aug 23 10:47:41.305 [notice] Tor can't help you if you use it wrong! Learn how 
to be safe at https://www.torproject.org/download/download#warning
Aug 23 10:47:41.305 [notice] Read configuration file 
"/usr/share/tor/tor-service-defaults-torrc".
Aug 23 10:47:41.305 [notice] Read configuration file "/etc/tor/torrc".
Aug 23 10:47:41.308 [notice] Opening Socks listener on 127.0.0.1:9050
Aug 23 10:47:41.308 [notice] Opening Control listener on /var/run/tor/control
Aug 23 10:47:41.000 [notice] Bootstrapped 0%: Starting
Aug 23 10:47:41.000 [notice] Signaled readiness to systemd
Aug 23 10:47:42.000 [notice] Bootstrapped 5%: Connecting to directory server
Aug 23 10:47:42.000 [notice] Bootstrapped 10%: Finishing handshake with 
directory server
Aug 23 10:47:43.000 [notice] Bootstrapped 15%: Establishing an encrypted 
directory connection
Aug 23 10:47:43.000 [notice] Bootstrapped 20%: Asking for networkstatus 
consensus
Aug 23 10:47:44.000 [notice] Bootstrapped 25%: Loading networkstatus consensus
Aug 23 10:47:45.000 [notice] I learned some more directory information, but not 
enough to build a circuit: We have no usable consensus.
Aug 23 10:47:46.000 [notice] Bootstrapped 40%: Loading authority key certs
Aug 23 10:47:47.000 [notice] Bootstrapped 45%: Asking for relay descriptors
Aug 23 10:47:47.000 [notice] I learned some more directory information, but not 
enough to build a circuit: We need more microdescriptors: we have 0/6976, and 
can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, 
and 0% of exit bw = 0% of path bw.)
Aug 23 10:47:47.000 [notice] Bootstrapped 50%: Loading relay descriptors
Aug 23 10:47:49.000 [notice] Bootstrapped 55%: Loading relay descriptors
Aug 23 10:47:49.000 [notice] Bootstrapped 62%: Loading relay descriptors
Aug 23 10:47:49.000 [notice] Bootstrapped 68%: Loading relay descriptors
Aug 23 10:47:49.000 [notice] Bootstrapped 74%: Loading relay descriptors
Aug 23 10:47:50.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Aug 23 10:47:50.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
Aug 23 10:47:50.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
Aug 23 10:47:50.000 [notice] Bootstrapped 100%: Done
Aug 23 10:51:51.000 [notice] Interrupt: exiting cleanly.
Aug 23 10:51:59.000 [notice] Tor 0.2.7.6 (git-605ae665009853bd) opening log 
file.
Aug 23 10:51:58.971 [warn] OpenSSL version from headers does not match the 
version we're running with. If you get weird crashes, that might be why. 
(Compiled with 1000205f: OpenSSL 1.0.2e 3 Dec 2015; running with 1000208f: 
OpenSSL 1.0.2h  3 May 2016).
Aug 23 10:51:59.012 [notice] Tor v0.2.7.6 (git-605ae665009853bd) running on 
Linux with Libevent 2.0.21-stable, OpenSSL 1.0.2h and Zlib 1.2.8.
Aug 23 10:51:59.012 [notice] Tor can't help you if you use it wrong! Learn how 
to be safe at https://www.torproject.org/download/download#warning
Aug 23 10:51:59.012 [notice] Read configuration file 
"/usr/share/tor/tor-service-defaults-torrc".
Aug 23 10:51:59.012 [notice] Read configuration file "/etc/tor/torrc".
Aug 23 10:51:59.018 [notice] Opening Socks listener on 127.0.0.1:9050
Aug 23 10:51:59.019 [notice] Opening Control listener on /var/run/tor/control
Aug 23 10:51:59.000 [notice] Bootstrapped 0%: Starting
Aug 23 10:51:59.000 [notice] Bootstrapped 5%: Connecting to directory server
Aug 23 10:51:59.000 [warn] Problem bootstrapping. Stuck at 5%: Connecting to 
directory server. (Network is unreachable; NOROUTE; count 1; recommendation 
warn; host 9EEAA02E338CDF5919F983F3245AA95A790B9B6C at 89.46.100.71:443)
Aug 23 10:51:59.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Aug 23 10:51:59.000 [notice] Signaled readiness to systemd
Aug 23 10:51:59.000 [warn] Problem bootstrapping. Stuck at 80%: Connecting to 
the Tor network. (Network is unreachable; NOROUTE; count 2; recommendation 
warn; host 1C90D3AEADFF3BCD079810632C8B85637924A58E at 62.210.82.44:21)
Aug 23 10:52:00.000 [warn] Problem bootstrapping. Stuck at 80%: Connecting to 
the Tor network. (Network is unreachable; NOROUTE; count 3; recommendation 
warn; host 86E78DD3720C78DA8673182EF96C54B162CD660C at 62.210.124.124:9001)
Aug 23 10:52:01.000 [warn] Problem bootstrapping. Stuck at 80%: Connecting to 
the Tor network. (Network is unreachable; NOROUTE; count 4; recommendation 
warn; host 

Bug#835119: tor client does not immediately open new circuits after standby

2016-08-22 Thread Viktor Jägersküpper
Package: tor
Version: 0.2.8.6-3
Severity: normal

Dear Maintainer,

I use tor only as a client to connect icedove to the tor network with
the extension Torbirdy (on port 9050). With the tor version 0.2.8.6 I
can't immediately connect to any mail server or news feed after the pc
woke up from standby ("long" time in standby) and I started icedove. I
have to wait for several minutes in order to connect successfully, but
the timespan seems to be random. This does not occur after a (re)boot.
The first version I remember to have this issue is 0.2.8.6-2, I did an
upgrade from 0.2.7.6-1 to 0.2.8.6-2, so I skipped the alpha and rc
versions and the first upload to unstable. I am very sure that the issue
didn't occur in version 0.2.7.6-1 which I used for several months. I can
exclude network connectivity problems because e.g. I can immediately
start the Tor Browser after standby.

Today I purged tor, installed version 0.2.7.6-1, copied the old "state"
file to /var/lib/tor, and set the pc in standby mode for a couple of
minutes. After waking up from standby I immediately tried to connect to
a mail server which worked. Then I upgraded step by step to every
version of tor 0.2.8 which I could find on snapshot.debian.org and tried
to connect to a mail server immediately after waking up from standby.
Unfortunately I could not reproduce the bug then. Finally with version
0.2.8.6-3 the bug occured again, but only after a "long" standby time
(almost 90 minutes).

Attached are two log files from the weekend and the complete log from
today after the installation of version 0.2.7.6-1.

As you can see, the bug is not easily reproducible, and the logs don't
show any particular reason for why tor does not open new circuits
immediately. Please tell me what I can do to give you more information
about the bug.

Regards
Viktor



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.6.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages tor depends on:
ii  adduser  3.115
ii  init-system-helpers  1.42
ii  libc62.23-4
ii  libevent-2.0-5   2.0.21-stable-2+b1
ii  libseccomp2  2.3.1-2
ii  libssl1.0.2  1.0.2h-1
ii  libsystemd0  231-4
ii  lsb-base 9.20160629
ii  zlib1g   1:1.2.8.dfsg-2+b1

Versions of packages tor recommends:
ii  logrotate3.8.7-2
pn  tor-geoipdb  
pn  torsocks 

Versions of packages tor suggests:
pn  apparmor-utils   
pn  mixmaster
pn  obfs4proxy   
pn  obfsproxy
pn  socat
ii  tor-arm  1.4.5.0-1.1
pn  torbrowser-launcher  

-- no debconf information
Aug 20 11:24:43.000 [notice] Tor 0.2.8.6 (git-89d2e261a925c6a6) opening new log 
file.
Aug 20 11:26:50.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
Aug 20 11:26:50.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
Aug 20 13:52:10.000 [notice] Your system clock just jumped 3486 seconds 
forward; assuming established circuits no longer work.
Aug 20 13:58:21.000 [notice] No circuits are opened. Relaxed timeout for 
circuit 22 (a General-purpose client 1-hop circuit in state doing handshakes 
with channel state open) to 337950ms. However, it appears the circuit has timed 
out anyway. 12 guards are live.
Aug 20 14:17:42.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
Aug 20 14:17:42.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
Aug 20 17:26:02.000 [notice] Your system clock just jumped 10956 seconds 
forward; assuming established circuits no longer work.
Aug 20 17:31:55.000 [notice] No circuits are opened. Relaxed timeout for 
circuit 29 (a General-purpose client 1-hop circuit in state doing handshakes 
with channel state open) to 337950ms. However, it appears the circuit has timed 
out anyway. 13 guards are live.
Aug 20 17:32:16.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
Aug 20 17:32:16.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
Aug 20 20:03:52.000 [notice] Your system clock just jumped 3806 seconds 
forward; assuming established circuits no longer work.
Aug 20 20:08:13.000 [notice] Tried for 120 seconds to get a connection to 
[scrubbed]:993. Giving up. (waiting for circuit)
Aug 20 20:10:18.000 [notice] Tried for 120 seconds to get a connection to 
[scrubbed]:993. Giving up. (waiting for circuit)
Aug 20 20:11:52.000 [notice] No circuits are opened. Relaxed timeout for 
circuit 40 (a General-purpose client 3-hop circuit in state doing handshakes 
with channel state