[tor-bugs] #9972 [Tor]: Failed to find node for hop 0 of our path. Discarding this circuit.
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Jun 5 19:29:08 UTC 2014
#9972: Failed to find node for hop 0 of our path. Discarding this circuit.
------------------------+------------------------------------
Reporter: mr-4 | Owner: nickm
Type: defect | Status: needs_revision
Priority: normal | Milestone: Tor: 0.2.6.x-final
Component: Tor | Version: Tor: 0.2.4.17-rc
Resolution: | Keywords: tor-client 025-triaged
Actual Points: | Parent ID:
Points: |
------------------------+------------------------------------
Comment (by asn):
I did some debugging using mr-4's config. Here is at least part of the
problem:
If we start with no state, we have 0 entry guards. When we call
`choose_random_entry_impl()` with `EntryNodes {US}` set, Tor is supposed
to use `entry_guards_set_from_config()` to add all entry nodes from the US
to the `entry_guards` list.
Then the `entry_guards` list is suppose to be filtered, so that in the end
we pick a single entry guard.
However, it seems that `entry_guards_set_from_config()` is called quite
early in the bootstrap process, and when it calls
`routerset_get_all_nodes()` (which is supposed to add all those US entry
guards) it gets to:
{{{
} else {
/* We need to iterate over the routerlist to get all the ones of the
* right kind. */
smartlist_t *nodes = nodelist_get_list();
SMARTLIST_FOREACH(nodes, const node_t *, node, {
}}}
but so early in the bootstrap process we don't have a consensus and
`nodelist_get_list()` just returns an empty smartlist. So no looping
happens, and no entry guards are added to our `entry_guards` smartlist.
To test this hypothesis, I added:
{{{
if (smartlist_len(entry_guards) > 1)
should_add_entry_nodes = 0;
}}}
in the end of `entry_guards_set_from_config()`, instead of zeroing
`should_add_entry_nodes` in the beginning. I just did this to test what
would happen if we keep on trying to add entry nodes till we succeed to
add at least one. With the above change, Tor managed to bootstrap
normally!
We should think of a smarter way to realize when we
`should_add_entry_nodes` should be toggled.
`entry_nodes_should_be_added()` is not smart enough.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9972#comment:24>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list