[tor-bugs] #20871 [Core Tor/Torsocks]: Regression in Torsocks 2.2.0 breaks wget, among others

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Dec 4 08:10:27 UTC 2016


#20871: Regression in Torsocks 2.2.0 breaks wget, among others
-------------------------------+-----------------------------------
 Reporter:  cypherpunks        |          Owner:  dgoulet
     Type:  defect             |         Status:  needs_information
 Priority:  High               |      Milestone:
Component:  Core Tor/Torsocks  |        Version:
 Severity:  Major              |     Resolution:
 Keywords:                     |  Actual Points:
Parent ID:                     |         Points:
 Reviewer:                     |        Sponsor:
-------------------------------+-----------------------------------

Comment (by cypherpunks):

 Well I found out why this is happening to my wget and not yours. I did
 more experimenting with compiling it with different flags. I've been
 compiling wget to try to eliminate variables, and realized that this
 problem occurs when wget is compiled with IPv6 disabled. IPv4 uses
 `gethostbyname()`, but if IPv6 is even enabled, then `getaddrinfo()` is
 used for both of them. See code starting on lines 327, 782, and 864 of
 wget 1.18's `src/host.c` for an example of this.

 Anyway, the debug info:

 {{{
 $ git show --pretty=oneline | head -n 1
 e54d80bc9595beeceac637b03e5c5395c07e62f7 Update version to v2.2.0

 $ git describe
 v2.2.0

 $ wget -V | head -n 3
 GNU Wget 1.18 built on linux-gnu.

 -cares +digest -gpgme +https -ipv6 -iri +large-file -metalink +nls

 $ TORSOCKS_CONF_FILE=doc/torsocks.conf TORSOCKS_LOG_LEVEL=5
 TORSOCKS_LOG_FILE_PATH=torsocks.log LD_PRELOAD=lib/torsocks/libtorsocks.so
 wget --spider https://www.torproject.org
 Spider mode enabled. Check if remote file exists.
 --2016-12-04 07:40:17--  https://www.torproject.org/
 Resolving www.torproject.org... failed: Unknown error.
 wget: unable to resolve host address ‘www.torproject.org’

 $ cat torsocks.log
 1480837264 DEBUG torsocks[36553]: Logging subsytem initialized. Level 5,
 file torsocks.log, time 1 (in init_logging() at torsocks.c:303)
 1480837264 DEBUG torsocks[36553]: Config file setting tor address to
 127.0.0.1 (in conf_file_set_tor_address() at
 config-file.c:298)
 1480837264 DEBUG torsocks[36553]: Config file setting tor port to 9050 (in
 conf_file_set_tor_port() at config-file.c:254)
 1480837264 DEBUG torsocks[36553]: [config] Onion address range set to
 127.42.42.0/24 (in set_onion_info() at config-file.c:108)
 1480837264 DEBUG torsocks[36553]: Config file doc/torsocks.conf opened and
 parsed. (in config_file_read() at config-file.c:572)
 1480837264 DEBUG torsocks[36553]: [fclose] Close caught for fd 4 (in
 tsocks_fclose() at fclose.c:45)
 1480837264 DEBUG torsocks[36553]: [onion] Pool init with subnet
 127.42.42.0 and mask 24 (in onion_pool_init() at onion.c:104)
 1480837264 DEBUG torsocks[36553]: [onion] Pool initialized with base 0,
 max_pos 255 and size 8 (in onion_pool_init() at onion.c:132)
 1480837264 DEBUG torsocks[36553]: [fclose] Close caught for fd 4 (in
 tsocks_fclose() at fclose.c:45)
 1480837264 DEBUG torsocks[36553]: [fclose] Close caught for fd 4 (in
 tsocks_fclose() at fclose.c:45)
 1480837264 DEBUG torsocks[36553]: [close] Close caught for fd 4 (in
 tsocks_close() at close.c:33)
 1480837264 DEBUG torsocks[36553]: [fclose] Close caught for fd 4 (in
 tsocks_fclose() at fclose.c:45)
 1480837264 DEBUG torsocks[36553]: [gethostbyname] Requesting
 www.torproject.org hostname (in tsocks_gethostbyname() at
 gethostbyname.c:68)
 1480837264 DEBUG torsocks[36553]: [onion] Destroying onion pool containing
 0 entry (in onion_pool_destroy() at onion.c:148)
 1480837264 DEBUG torsocks[36553]: [fclose] Close caught for fd 3 (in
 tsocks_fclose() at fclose.c:45)
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20871#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list