[tor-bugs] #23588 [Core Tor/Tor]: Write fascist_firewall_choose_address_ls() and use it in hs_get_extend_info_from_lspecs()
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Aug 14 18:24:49 UTC 2018
#23588: Write fascist_firewall_choose_address_ls() and use it in
hs_get_extend_info_from_lspecs()
-------------------------------------------------+-------------------------
Reporter: teor | Owner: neel
Type: defect | Status:
| needs_revision
Priority: Medium | Milestone: Tor:
| 0.3.5.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: prop224, tor-hs, single-onion, | Actual Points:
ipv6, 034-triage-20180328, |
034-removed-20180328 |
Parent ID: #23493 | Points: 1
Reviewer: teor | Sponsor:
-------------------------------------------------+-------------------------
Comment (by neel):
I tried using `BUG()` here:
{{{
neel at kat:~/tor/tor % git diff
diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c
index df43d5cde..35e5d9ac1 100644
--- a/src/feature/hs/hs_common.c
+++ b/src/feature/hs/hs_common.c
@@ -1724,7 +1724,7 @@ hs_get_extend_info_from_lspecs(const smartlist_t
*lspecs,
fascist_firewall_choose_address_ls(lspecs, 0, &ap, direct_conn);
/* Legacy ID is mandatory, and we require an IP address. */
- if (!tor_addr_port_is_valid_ap(&ap, 0) || !have_legacy_id) {
+ if (BUG(!tor_addr_port_is_valid_ap(&ap, 0)) || !have_legacy_id) {
/* If we're missing the legacy ID or the IP address, return NULL. */
goto done;
}
neel at kat:~/tor/tor %
}}}
I compiled the code and ran `make test-network-all` and got this:
{{{
neel at kat:~/tor/tor % make test-network-all
mkdir -p ./test_network_log
ping6 ::1 or ping ::1 succeeded, running IPv6 flavors: bridges+ipv6-min
ipv6-exi
t-min hs-v23-ipv6-md single-onion-ipv6-md.
tor-stable not found, skipping mixed flavors: mixed+hs-v23.
SKIP: mixed+hs-v23
PASS: basic-min
FAIL: bridges-min
PASS: hs-v2-min
PASS: hs-v3-min
PASS: single-onion-v23
FAIL: bridges+ipv6-min
PASS: ipv6-exit-min
FAIL: hs-v23-ipv6-md
Detail: chutney/tools/warnings.sh
/usr/home/neel/tor/chutney//net/nodes.1534250$
96
Warning: Bug: 0x107a055 <_start+0xa5> at
/usr/home/neel/tor/tor/src/app/tor
(on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x107a249 <main+0x19> at
/usr/home/neel/tor/tor/src/app/tor ($
n Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x107a3ac <tor_main+0x4c> at
/usr/home/neel/tor/tor/src/app/t$
r (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x107a6b4 <connection_add_impl+0x1f4> at
/usr/home/neel/tor/to
r/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 5
Warning: Bug: 0x107d1e1 <do_main_loop+0x421> at
/usr/home/neel/tor/tor/src/a
pp/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x107ef90 <tor_run_main+0xe0> at
/usr/home/neel/tor/tor/src/ap
p/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x10a580b <connection_ap_handshake_attach_circuit+0x46b>
at /u
sr/home/neel/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev
b4b67c5fb5205e9a) Num
ber: 24
Warning: Bug: 0x10a6168 <connection_ap_handshake_attach_circuit+0xdc8>
at /u
sr/home/neel/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev
b4b67c5fb5205e9a) Num
ber: 24
Warning: Bug: 0x10a799f <command_process_cell+0x72f> at
/usr/home/neel/tor/t
or/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 1
Warning: Bug: 0x10ab0ea <connection_ap_attach_pending+0xda> at
/usr/home/nee
l/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number:
24
Warning: Bug: 0x10b0c72 <connection_or_process_inbuf+0x1b2> at
/usr/home/nee
l/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number:
1
Warning: Bug: 0x10c0059 <circuit_receive_relay_cell+0x349> at
/usr/home/neel
/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 1
Warning: Bug: 0x10c05c2 <circuit_receive_relay_cell+0x8b2> at
/usr/home/neel
/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 1
Warning: Bug: 0x10f4b3e <connection_dir_reached_eof+0x2e> at
/usr/home/neel/
tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 4
Warning: Bug: 0x10f6ce8 <connection_dir_reached_eof+0x21d8> at
/usr/home/nee
l/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number:
4
Warning: Bug: 0x110a125 <hs_circ_handle_introduce2+0x155> at
/usr/home/neel/
tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 1
Warning: Bug: 0x110e0a1 <hs_client_get_random_intro_from_edge+0x211>
at /usr
/home/neel/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a)
Numbe
r: 24
Warning: Bug: 0x110ed8e <hs_client_dir_info_changed+0x5e> at
/usr/home/neel/
tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 4
Warning: Bug: 0x1111cfc <hs_get_extend_info_from_lspecs+0x21c> at
/usr/home/
neel/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a)
Number: 25
Warning: Bug: 0x1118cac <hs_service_receive_introduce2+0xbc> at
/usr/home/ne
el/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number:
1
Warning: Bug: 0x11222b4 <networkstatus_set_current_consensus+0xe04> at
/usr/
home/neel/tor/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a)
Number
: 4
Warning: Bug: 0x116081d <rend_process_relay_cell+0x18d> at
/usr/home/neel/to
r/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 1
Warning: Bug: 0x11a1ce3 <connection_handle_read+0x8a3> at
/usr/home/neel/tor
/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 1
Warning: Bug: 0x11a1f97 <connection_handle_read+0xb57> at
/usr/home/neel/tor
/tor/src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 4
Warning: Bug: 0x120fcf1 <tor_bug_occurred_+0x111> at
/usr/home/neel/tor/tor/
src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x121370c <log_backtrace_impl+0x4c> at
/usr/home/neel/tor/tor/
src/app/tor (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x801b54f4e <event_base_loop+0x50e> at
/usr/local/lib/libevent
-2.1.so.6 (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 29
Warning: Bug: 0x801b58da0 <event_base_assert_ok_nolock_+0x9d0> at
/usr/local
/lib/libevent-2.1.so.6 (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number:
24
Warning: Bug: 0x801b5906f <event_base_assert_ok_nolock_+0xc9f> at
/usr/local
/lib/libevent-2.1.so.6 (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number:
5
Warning: Bug: Non-fatal assertion !(!tor_addr_port_is_valid_ap(&ap, 0))
failed i
n hs_get_extend_info_from_lspecs at src/feature/hs/hs_common.c:1727. Stack
trace
: (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 25
Warning: Bug: Non-fatal assertion !(status == HS_CLIENT_FETCH_HAVE_DESC)
failed
in retry_all_socks_conn_waiting_for_desc at
src/feature/hs/hs_client.c:275. Stac
k trace: (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 4
Warning: Didn't recognize cell, but circ stops here! Closing circ. Number:
1
Warning: Every introduction point for service
cuq3slyq45o3smrd4chykbhklcltdfbg63
xopsezrwrxrfi3hkbtznad is unusable or we can't extend to it. We can't
connect. N
umber: 8
Warning: Not enough info to open a circuit to a rendezvous point for
hidden serv
ice cuq3slyq45o3smrd4chykbhklcltdfbg63xopsezrwrxrfi3hkbtznad. Number: 1
Warning: tor_bug_occurred_: Bug: src/feature/hs/hs_client.c:275:
retry_all_socks
_conn_waiting_for_desc: Non-fatal assertion !(status ==
HS_CLIENT_FETCH_HAVE_DES
C) failed. (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 4
Warning: tor_bug_occurred_: Bug: src/feature/hs/hs_common.c:1727:
hs_get_extend_
info_from_lspecs: Non-fatal assertion !(!tor_addr_port_is_valid_ap(&ap,
0)) fail
ed. (on Tor 0.3.5.0-alpha-dev b4b67c5fb5205e9a) Number: 25
PASS: single-onion-ipv6-md
Log and result files are available in ./test_network_log.
*** Error code 1
Stop.
make: stopped in /usr/home/neel/tor/tor
neel at kat:~/tor/tor %
}}}
This error is very similar to what you got. Surprisingly, I did not get
this error on two laptops from different brands (I tested FreeBSD on both
Dell and HP), so I am testing it on a server where the tests are more
accurate.
Is the above code sample wrong (it hasn't been committed to git)? Can I
fix it here, or should I do #23818 first, then update my branch for this
patch with the latest Tor code, and then finish the patch?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23588#comment:34>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list