torsocks-2.2.0-rc1 segfaults emacs(notmuch) and git
The current package definition to reproduce this with GNU Guix can be found here (https://lists.gnu.org/archive/html/guix-devel/2016-07/msg01452.html). I've been using and testing this since torsocks-2.2.0-rc1 was announced publicly.
I can not reprocude this behavior on Gentoo as I lack the use cases there but could try to reproduce at least emacs -f notmuch if requested.
I do not really know how to debug bash scripts (knowing that gdb is of no use there), so I can only provide the output of torsocks -debug in the problematic cases.
The situation:
Before a big upgrade which involved a version bump of libc and others (see https://lists.gnu.org/archive/html/guix-devel/2016-08/msg00219.html), the following all worked:
my.nemesismud (){ . torsocks on powwow ~/tmux_ng0_nemesismud.powwow . torsocks off }
my.notmuch() { . torsocks on emacs -nw -f notmuch . torsocks off }
my.powwow() { . torsocks on powwow ~/tmux_ng0_psycmuve.powwow . torsocks off } my.pb.pb() { . torsocks on curl -F "c=@${1:--}" https://ptpb.pw/ . torsocks off }
getmail.sh (which runs among other things a wrapper around "getmail" with . torsocks on; ... ; . torsocks off; for the relevant 'getmail' part, connection to .onion addresses)
Now after this upgrade the following terminate with segfault: my.notmuch, torify git fetch upstream (where upstream is a .onion in a collab. project), the rest is still functional (pb, powwow and other applications):
(example failing notmuch)
ng0@shadowwalker ~$ my.notmuch Tor mode activated. Every command will be torified for this shell. Segmentation fault Tor mode deactivated. Command will NOT go through Tor anymore.
The -debug output of something equal to my.notmuch is:
ng0@shadowwalker ~$ torsocks -d emacs -f notmuch 1470329062 DEBUG torsocks[19142]: Logging subsytem initialized. Level 5, file (null), time 1 (in init_logging() at torsocks.c:303) 1470329062 DEBUG torsocks[19142]: Config file not provided by TORSOCKS_CONF_FILE. Using default /gnu/store/bhnzp8cvdh6q2k92iljl8bacsqrwr02s-torsocks-2.2.0-rc1/etc/tor/torsocks.conf (in config_file_read() at config-file.c:543) 1470329062 DEBUG torsocks[19142]: Config file setting tor address to 127.0.0.1 (in conf_file_set_tor_address() at config-file.c:298) 1470329062 DEBUG torsocks[19142]: Config file setting tor port to 9050 (in conf_file_set_tor_port() at config-file.c:254) 1470329062 DEBUG torsocks[19142]: [config] Onion address range set to 127.42.42.0/24 (in set_onion_info() at config-file.c:108) 1470329062 DEBUG torsocks[19142]: Config file /gnu/store/bhnzp8cvdh6q2k92iljl8bacsqrwr02s-torsocks-2.2.0-rc1/etc/tor/torsocks.conf opened and parsed. (in config_file_read() at config-file.c:572) 1470329062 DEBUG torsocks[19142]: [fclose] Close catched for fd 3 (in tsocks_fclose() at fclose.c:45) 1470329062 DEBUG torsocks[19142]: [onion] Pool init with subnet 127.42.42.0 and mask 24 (in onion_pool_init() at onion.c:104) 1470329062 DEBUG torsocks[19142]: [onion] Pool initialized with base 0, max_pos 255 and size 8 (in onion_pool_init() at onion.c:132) 1470329062 DEBUG torsocks[19142]: Close catched for fd 3 (in tsocks_close() at close.c:33) 1470329062 DEBUG torsocks[19142]: Close catched for fd 3 (in tsocks_close() at close.c:33) 1470329062 DEBUG torsocks[19142]: Logging subsytem initialized. Level 5, file (null), time 1 (in init_logging() at torsocks.c:303) 1470329062 DEBUG torsocks[19142]: Config file not provided by TORSOCKS_CONF_FILE. Using default /gnu/store/bhnzp8cvdh6q2k92iljl8bacsqrwr02s-torsocks-2.2.0-rc1/etc/tor/torsocks.conf (in config_file_read() at config-file.c:543) 1470329062 DEBUG torsocks[19142]: Config file setting tor address to 127.0.0.1 (in conf_file_set_tor_address() at config-file.c:298) 1470329062 DEBUG torsocks[19142]: Config file setting tor port to 9050 (in conf_file_set_tor_port() at config-file.c:254) 1470329062 DEBUG torsocks[19142]: [config] Onion address range set to 127.42.42.0/24 (in set_onion_info() at config-file.c:108) 1470329062 DEBUG torsocks[19142]: Config file /gnu/store/bhnzp8cvdh6q2k92iljl8bacsqrwr02s-torsocks-2.2.0-rc1/etc/tor/torsocks.conf opened and parsed. (in config_file_read() at config-file.c:572) 1470329062 DEBUG torsocks[19142]: [fclose] Close catched for fd 3 (in tsocks_fclose() at fclose.c:45) 1470329062 DEBUG torsocks[19142]: [onion] Pool init with subnet 127.42.42.0 and mask 24 (in onion_pool_init() at onion.c:104) 1470329062 DEBUG torsocks[19142]: [onion] Pool initialized with base 0, max_pos 255 and size 8 (in onion_pool_init() at onion.c:132) 1470329062 DEBUG torsocks[19142]: Close catched for fd 3 (in tsocks_close() at close.c:33) 1470329062 DEBUG torsocks[19142]: Close catched for fd 3 (in tsocks_close() at close.c:33) 1470329062 DEBUG torsocks[19142]: Logging subsytem initialized. Level 5, file (null), time 1 (in init_logging() at torsocks.c:303) Segmentation fault
for git it is the same:
ng0@shadowwalker ~/src/gentoo-overlays/youbroketheinternet-overlay$ torsocks -d git fetch upstream 1470329332 DEBUG torsocks[19370]: Logging subsytem initialized. Level 5, file (null), time 1 (in init_logging() at torsocks.c:303) 1470329332 DEBUG torsocks[19370]: Config file not provided by TORSOCKS_CONF_FILE. Using default /gnu/store/bhnzp8cvdh6q2k92iljl8bacsqrwr02s-torsocks-2.2.0-rc1/etc/tor/torsocks.conf (in config_file_read() at config-file.c:543) 1470329332 DEBUG torsocks[19370]: Config file setting tor address to 127.0.0.1 (in conf_file_set_tor_address() at config-file.c:298) 1470329332 DEBUG torsocks[19370]: Config file setting tor port to 9050 (in conf_file_set_tor_port() at config-file.c:254) 1470329332 DEBUG torsocks[19370]: [config] Onion address range set to 127.42.42.0/24 (in set_onion_info() at config-file.c:108) 1470329332 DEBUG torsocks[19370]: Config file /gnu/store/bhnzp8cvdh6q2k92iljl8bacsqrwr02s-torsocks-2.2.0-rc1/etc/tor/torsocks.conf opened and parsed. (in config_file_read() at config-file.c:572) 1470329332 DEBUG torsocks[19370]: [fclose] Close catched for fd 3 (in tsocks_fclose() at fclose.c:45) 1470329332 DEBUG torsocks[19370]: [onion] Pool init with subnet 127.42.42.0 and mask 24 (in onion_pool_init() at onion.c:104) 1470329332 DEBUG torsocks[19370]: [onion] Pool initialized with base 0, max_pos 255 and size 8 (in onion_pool_init() at onion.c:132) 1470329332 DEBUG torsocks[19370]: Close catched for fd 3 (in tsocks_close() at close.c:33) 1470329332 DEBUG torsocks[19370]: Close catched for fd 3 (in tsocks_close() at close.c:33) 1470329332 DEBUG torsocks[19370]: Logging subsytem initialized. Level 5, file (null), time 1 (in init_logging() at torsocks.c:303) Segmentation fault
I'd like to resolve this bug and push a functional 2.2.x release in our system once the next version release of torsocks is out. If there's anything I can provide additionally, let me know.
Trac:
Username: ng0