Nick Mathewson [Tue, 30 Jul 2019 16:07:40 +0000 (12:07 -0400)]
Practracker: add an integration test.
This test runs practracker with a set of 0 thresholds, to make sure
that it enumerates all its values right. It tries running with an
empty exceptions file, and with an exceptions file that covers
_some_ of the data, and it makes sure that the outputs are as expected.
Nick Mathewson [Tue, 30 Jul 2019 15:54:05 +0000 (11:54 -0400)]
practracker: better warning/regen handling
Now that there is only one toplevel place where we print problems,
we can redirect just that one print to a file when we are
regenerating the exceptions.txt file. Previously we redirected
sys.stdout, which is naughty, and forced us to send warnings (and
warnings alone) to stderr.
Nick Mathewson [Tue, 30 Jul 2019 15:49:50 +0000 (11:49 -0400)]
Practracker: new flags to control output.
These flags let you suppress the message about the number of
problems and warnings, and let you control the thresholds above
which something counts as a problem.
Nick Mathewson [Tue, 30 Jul 2019 13:20:08 +0000 (09:20 -0400)]
practracker: Refactor flow to use generators
Instead of having "consider" functions that have to call a global
ProblemVault, we can now generate all the metrics for the code
separately from the decision about what to do for them.
Nick Mathewson [Tue, 30 Jul 2019 13:03:55 +0000 (09:03 -0400)]
practracker: Rename "Problem" to "Item".
I'm about to refactor the code into a set of iterators that yield
*all* the metrics for the code, and then add a filter on top of that
to return the problems.
Nick Mathewson [Tue, 23 Jul 2019 16:36:40 +0000 (12:36 -0400)]
Allow NULL circ->p_chan in circuit_is_suitable_for_introduce1()
This shouldn't be possible while Tor is running, but the tests can
hit this code. Rather than force the tests to add a dummy channel
object, let's just tolerate their incompletely built circuits.
Nick Mathewson [Fri, 19 Jul 2019 13:49:52 +0000 (09:49 -0400)]
Set 'routerlist' global to NULL before freeing it.
There is other code that uses this value, and some of it is
apparently reachable from inside router_dir_info_changed(), which
routerlist_free() apparently calls. (ouch!) This is a minimal fix
to try to resolve the issue without causing other problems.
Fixes bug 31003. I'm calling this a bugfix on 0.1.2.2-alpha, where
the call to router_dir_info_changed() was added to routerlist_free().
Overflowing a signed integer in C is an undefined behaviour.
It is possible to trigger this undefined behaviour in tor_asprintf on
Windows or systems lacking vasprintf.
On these systems, eiter _vscprintf or vsnprintf is called to retrieve
the required amount of bytes to hold the string. These functions can
return INT_MAX. The easiest way to recreate this is the use of a
specially crafted configuration file, e.g. containing the line:
Nick Mathewson [Wed, 17 Jul 2019 12:30:12 +0000 (14:30 +0200)]
Practracker: improve exclude-directory logic
Instead of excluding directories at the last minute if they happen
to appear in our filenames, we exclude them early, before recursing
into all their subdirectories.
Nick Mathewson [Wed, 17 Jul 2019 12:00:28 +0000 (14:00 +0200)]
Fix practracker_tests.py and practracker line counting.
The practracker_tests.py unit test file called a function by its old
name.
Also, practracker counted functions as starting one line after the
function name, and ending with the closing brace. Now they start
with the open brace and end with the closing brace.
Nick Mathewson [Fri, 28 Jun 2019 15:57:36 +0000 (11:57 -0400)]
Coverity: different implementation for csiphash
Coverity has had trouble figuring out our csiphash implementation,
and has given spurious warnings about its behavior.
This patch changes the csiphash implementation when coverity is in
use, so that coverity can figure out that we are not about to read
beyond the provided input.
teor [Fri, 28 Jun 2019 11:37:37 +0000 (21:37 +1000)]
changes: file for 28795
Replace the 157 fallbacks originally introduced in Tor 0.3.5.6-rc
in December 2018 (of which ~122 were still functional), with a
list of 148 fallbacks (70 new, 78 existing, 79 removed) generated
in June 2019.
Closes ticket 28795.
Note that we created extra lists from DE and US, but they didn't add
any more fallbacks when we tried to merge them.