]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agoAdd is_leaf and send_to_prune_tree.
Mark Andrews [Thu, 5 Dec 2019 23:08:52 +0000 (10:08 +1100)] 
Add is_leaf and send_to_prune_tree.

Add is_leaf and send_to_prune_tree to make the logic easier
to understand in cleanup_dead_nodes and decrement_reference.

6 years agoTesting node->down requires the tree lock to be held.
Mark Andrews [Wed, 4 Dec 2019 10:41:04 +0000 (21:41 +1100)] 
Testing node->down requires the tree lock to be held.

In decrement_reference only test node->down if the tree lock
is held.  As node->down is not always tested in
decrement_reference we need to test that it is non NULL in
cleanup_dead_nodes prior to removing the node from the rbt
tree.  Additionally it is not always possible to aquire the
node lock and reactivate a node when adding parent nodes.
Reactivate such nodes in cleanup_dead_nodes if required.

6 years agoMerge branch '1453-the-zero-system-test-timeouts-intermittently' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 17:41:25 +0000 (17:41 +0000)] 
Merge branch '1453-the-zero-system-test-timeouts-intermittently' into 'master'

Bail-out early if dig fails to finish successfully or takes too long

Closes #1453

See merge request isc-projects/bind9!2712

6 years agoMerge branch '1458-intermittent-failure-in-the-forward-system-test' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 17:15:53 +0000 (17:15 +0000)] 
Merge branch '1458-intermittent-failure-in-the-forward-system-test' into 'master'

Resolve "Intermittent failure in the forward system test"

Closes #1458

See merge request isc-projects/bind9!2716

6 years agoBail-out early if dig fails to finish successfully or takes too long
Ondřej Surý [Thu, 5 Dec 2019 17:09:21 +0000 (18:09 +0100)] 
Bail-out early if dig fails to finish successfully or takes too long

Before, the zero system test could get stuck almost infinitely, because
the first test sends > 300 queries with 5 seconds timeout on each in
each pass.  If named crashed early, it would took the test more than 4
hours to properly timeout.

This commit introduces a "watchdog" on the dig commands running in the
background and failing the test on timeout, failing any test if any dig
command fails to return successfully, and making the tests.sh script
shellcheck clean.

6 years agoWait for named to forward the question before testing the validity
Ondřej Surý [Fri, 6 Dec 2019 10:54:54 +0000 (11:54 +0100)] 
Wait for named to forward the question before testing the validity

6 years agoMake forward system test shellcheck clean
Ondřej Surý [Fri, 6 Dec 2019 10:17:33 +0000 (11:17 +0100)] 
Make forward system test shellcheck clean

6 years agoUse $n to keep diagnostic output of every individual test separate
Ondřej Surý [Fri, 6 Dec 2019 10:07:28 +0000 (11:07 +0100)] 
Use $n to keep diagnostic output of every individual test separate

6 years agoAdd the standard $n to each test
Ondřej Surý [Fri, 6 Dec 2019 10:03:54 +0000 (11:03 +0100)] 
Add the standard $n to each test

6 years agoMerge branch '1425-intermittent-failure-in-the-addzone-system-test' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 16:27:31 +0000 (16:27 +0000)] 
Merge branch '1425-intermittent-failure-in-the-addzone-system-test' into 'master'

Resolve "Intermittent failure in the addzone system test"

Closes #1425

See merge request isc-projects/bind9!2714

6 years agotests: addzone: retry when checking for things, to allow for timing problems
Witold Kręcicki [Mon, 9 Dec 2019 08:25:40 +0000 (09:25 +0100)] 
tests: addzone: retry when checking for things, to allow for timing problems

6 years agoloop waiting for the redirect zone to load
Mark Andrews [Fri, 6 Dec 2019 02:30:14 +0000 (13:30 +1100)] 
loop waiting for the redirect zone to load

6 years agoMerge branch '1466-kasp-test-keyid-0' into 'master'
Matthijs Mekking [Mon, 9 Dec 2019 14:42:08 +0000 (14:42 +0000)] 
Merge branch '1466-kasp-test-keyid-0' into 'master'

Fix get key id from key_idpad

Closes #1466

See merge request isc-projects/bind9!2731

6 years agoFix get key id from key_idpad
Matthijs Mekking [Mon, 9 Dec 2019 13:54:04 +0000 (14:54 +0100)] 
Fix get key id from key_idpad

The kasp system test has a call to sed to retrieve the key identifier
without leading zeros.  The sed call could not handle key id 0.
Update the kasp test to also correctly deal with this case.

6 years agoMerge branch '1457-intermittent-failure-autosign' into 'master'
Matthijs Mekking [Mon, 9 Dec 2019 13:29:36 +0000 (13:29 +0000)] 
Merge branch '1457-intermittent-failure-autosign' into 'master'

Resolve "Intermittent failure in the autosign system test"

Closes #1457

See merge request isc-projects/bind9!2729

6 years agoBetter error handling in autosign system test
Matthijs Mekking [Mon, 9 Dec 2019 10:22:57 +0000 (11:22 +0100)] 
Better error handling in autosign system test

6 years agoFix race in autosign test
Matthijs Mekking [Mon, 9 Dec 2019 07:26:46 +0000 (08:26 +0100)] 
Fix race in autosign test

The autosign test has a test case where a DNSSEC maintaiend zone
has a set of DNSSEC keys without any timing metadata set.  It
tests if named picks up the key for publication and signing if a
delayed dnssec-settime/loadkeys event has occured.

The test failed intermittently despite the fact it sleeps for 5
seconds but the triggered key reconfigure action should happen after
3 seconds.

However, the test output showed that the test query came in before
the key reconfigure action was complete (see excerpts below).

The loadkeys command is received:

15:38:36 received control channel command 'loadkeys delay.example.'

The reconfiguring zone keys action is triggered after 3 seconds:

15:38:39 zone delay.example/IN: reconfiguring zone keys
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7484 (ZSK) is now published
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7455 (KSK) is now published
15:38:39 writing to journal

Two seconds later the test query comes in:

15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: query
15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: endrequest

And 6 more seconds later the reconfigure keys action is complete:

15:38:47 zone delay.example/IN: next key event: 05-Dec-2019 15:48:39

This commit fixes the test by checking the "next key event" log has
been seen before executing the test query, making sure that the
reconfigure keys action has been complete.

This commit however does not fix, nor explain why it took such a long
time (8 seconds) to reconfigure the keys.

6 years agoMove wait_for_log to conf.sh.common
Matthijs Mekking [Fri, 6 Dec 2019 16:16:45 +0000 (17:16 +0100)] 
Move wait_for_log to conf.sh.common

6 years agoSave settime output
Matthijs Mekking [Fri, 6 Dec 2019 15:48:49 +0000 (16:48 +0100)] 
Save settime output

6 years agoMerge branch 'misc-fixes-kasp' into 'master'
Matthijs Mekking [Mon, 9 Dec 2019 08:22:56 +0000 (08:22 +0000)] 
Merge branch 'misc-fixes-kasp' into 'master'

Miscellaneous fixes kasp

See merge request isc-projects/bind9!2711

6 years agoChange some dnssec-policy defaults
Matthijs Mekking [Thu, 5 Dec 2019 11:17:19 +0000 (12:17 +0100)] 
Change some dnssec-policy defaults

Suggested by Tony Finch, these seem to be more reasonable defaults.

6 years agoDefault key size 2048
Matthijs Mekking [Thu, 5 Dec 2019 10:16:53 +0000 (11:16 +0100)] 
Default key size 2048

The default size for RSA keys is 2048 bits, for both ZSKs and KSKs.

6 years agoUpdate docs with durations, built-in dnssec-policy
Matthijs Mekking [Thu, 5 Dec 2019 09:47:20 +0000 (10:47 +0100)] 
Update docs with durations, built-in dnssec-policy

Clarify in the ARM that TTL-style options can also now take ISO
8601 durations.

Mention the built-in dnssec policies "default" and "none".  Mention
that "none" is the default.

Add a file documenting the default dnssec-policy configuration options.

Fix dnssec-policy syntax in ARM (dnssec-policy.grammar.xml).

6 years agoMerge branch 'ondrej/remove-too-generic-node_count-macro-from-dns_acl' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 06:49:00 +0000 (06:49 +0000)] 
Merge branch 'ondrej/remove-too-generic-node_count-macro-from-dns_acl' into 'master'

Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace

See merge request isc-projects/bind9!2725

6 years agoChange the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the...
Ondřej Surý [Fri, 6 Dec 2019 14:47:39 +0000 (15:47 +0100)] 
Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace

6 years agoMerge branch '1401-intermittent-failures-in-the-catz-system-test' into 'master'
Mark Andrews [Fri, 6 Dec 2019 14:16:03 +0000 (14:16 +0000)] 
Merge branch '1401-intermittent-failures-in-the-catz-system-test' into 'master'

Debug "Intermittent failures in the catz system test"

See merge request isc-projects/bind9!2715

6 years agoIncrease wait_for_message attempts to 20.
Mark Andrews [Fri, 6 Dec 2019 05:44:27 +0000 (16:44 +1100)] 
Increase wait_for_message attempts to 20.

6 years agosave wait_for_message contents
Mark Andrews [Fri, 6 Dec 2019 03:52:06 +0000 (14:52 +1100)] 
save wait_for_message contents

6 years agoMerge branch '1452-system-test-framework-cleanup-tweaks' into 'master'
Michał Kępień [Fri, 6 Dec 2019 13:32:07 +0000 (13:32 +0000)] 
Merge branch '1452-system-test-framework-cleanup-tweaks' into 'master'

System test framework: cleanup tweaks

Closes #1452

See merge request isc-projects/bind9!2717

6 years agoMerge branch '1452-detect-missing-system-test-results' into 'master'
Michał Kępień [Fri, 6 Dec 2019 13:24:26 +0000 (13:24 +0000)] 
Merge branch '1452-detect-missing-system-test-results' into 'master'

Detect missing system test results

See merge request isc-projects/bind9!2708

6 years agoAutomatically run clean.sh from run.sh
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Automatically run clean.sh from run.sh

The first step in all existing setup.sh scripts is to call clean.sh.  To
reduce code duplication and ensure all system tests added in the future
behave consistently with existing ones, invoke clean.sh from run.sh
before calling setup.sh.

6 years agoDetect missing system test results
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Detect missing system test results

At the end of each system test suite run, the system test framework
collects all existing test.output files from system test subdirectories
and produces bin/tests/system/systests.output from those files.
However, it does not check whether a test.output file was found for
every executed test.  Thus, if the test.output file is accidentally
deleted by the system test itself (e.g. due to an overly broad file
removal wildcard present in clean.sh), its output will not be included
in bin/tests/system/systests.output.  Since the result of each system
test suite run is determined by bin/tests/system/testsummary.sh, which
only operates on the contents of bin/tests/system/systests.output, this
can lead to test failures being ignored.  Fix by ensuring the number of
test results found in bin/tests/system/systests.output is equal to the
number of tests run and triggering a system test suite failure in case
of a discrepancy between these two values.

6 years agoRemove bin/tests/system/clean.sh
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Remove bin/tests/system/clean.sh

Since the role of the bin/tests/system/clean.sh script has now been
reduced to calling a given system test's clean.sh script, remove the
former altogether and replace its only use with a direct invocation of
the latter.

6 years agoRemove the -r switch from system test scripts
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Remove the -r switch from system test scripts

Since files containing system test output are no longer stored in test
subdirectories, bin/tests/system/clean.sh no longer needs to take care
of removing the test.output file for a given test as testsummary.sh
already takes care of that and even if a test suite terminates
abnormally and another one is started, tee invoked without the -a
command line switch overwrites the destination file if it exists, so
leftover test.output.* files from previous test suite runs are not a
concern.  Remove the -r command line switch and the code associated with
it from the relevant scripts.

6 years agoStore system test output in bin/tests/system/
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Store system test output in bin/tests/system/

Some clean.sh scripts contain overly broad file deletion wildcards which
cause the test.output file (used by the system test framework for
collecting output) in a given system test's directory to be erroneously
removed immediately after the test is started (due to setup.sh scripts
calling clean.sh at the beginning).  This prevents the test's output
from being placed in bin/tests/system/systests.output at the end of a
test suite run and thus can lead to test failures being ignored.  Fix by
storing each test's output in a test.output.<test-name> file in
bin/tests/system/, which prevents clean.sh scripts from removing it (as
they should only ever affect files contained in a given system test's
directory).

6 years agoMerge branch '1460-duration-ttlval-print-bug' into 'master'
Matthijs Mekking [Fri, 6 Dec 2019 13:03:14 +0000 (13:03 +0000)] 
Merge branch '1460-duration-ttlval-print-bug' into 'master'

Resolve "checkconf test failure on Solaris"

Closes #1460

See merge request isc-projects/bind9!2718

6 years agoAdd semantic patch to find void f() { ... return ((void)g())); ... }
Ondřej Surý [Fri, 6 Dec 2019 12:29:04 +0000 (13:29 +0100)] 
Add semantic patch to find void f() { ... return ((void)g())); ... }

When a function returns void, it can be used as an argument to return in
function returning also void, e.g.:

void in(void) {
  return;
}

void out(void) {
  return (in());
}

while this is legal, it should be rewritten as:

void out(void) {
  in();
  return;
}

The semantic patch just find the occurrences, and they need to be fixed
by hand.

6 years agoFix duration printing on Solaris
Matthijs Mekking [Fri, 6 Dec 2019 12:12:06 +0000 (13:12 +0100)] 
Fix duration printing on Solaris

6 years agoReplace two leftover ttlval with duration
Matthijs Mekking [Fri, 6 Dec 2019 11:28:40 +0000 (12:28 +0100)] 
Replace two leftover ttlval with duration

Since the introduction of durations, all ttlval configuration types
are replaced with durations.  Duration is an ISO 8601 duration, a
TTL-style value, or a number.  These two references were missed and
are now also replaced.

6 years agoMerge branch 'trust-anchors-minor-fixes' into 'master'
Matthijs Mekking [Fri, 6 Dec 2019 08:12:55 +0000 (08:12 +0000)] 
Merge branch 'trust-anchors-minor-fixes' into 'master'

Minor fixes in trust anchor code

See merge request isc-projects/bind9!2676

6 years agoMinor fixes in trust anchor code
Matthijs Mekking [Mon, 2 Dec 2019 08:29:02 +0000 (09:29 +0100)] 
Minor fixes in trust anchor code

This commit makes some minor changes to the trust anchor code:

1. Replace the undescriptive n1, n2 and n3 identifiers with slightly
   better rdata1, rdata2, and rdata3.
2. Fix an occurrence where in the error log message a static number
   32 was printed, rather than the rdata3 length.
3. Add a default case to the switch statement checking DS digest
   algorithms to catch unknown algorithms.

6 years agoMerge branch '1455-job-failed-453300' into 'master'
Mark Andrews [Thu, 5 Dec 2019 22:05:24 +0000 (22:05 +0000)] 
Merge branch '1455-job-failed-453300' into 'master'

Resolve "Job Failed #453300"

Closes #1455

See merge request isc-projects/bind9!2706

6 years agoloop waiting for the redirect zone to load
Mark Andrews [Wed, 4 Dec 2019 23:42:33 +0000 (10:42 +1100)] 
loop waiting for the redirect zone to load

6 years agoMerge branch '1427-intermittent-failure-in-fetchlimit-system-test' into 'master'
Ondřej Surý [Thu, 5 Dec 2019 15:55:24 +0000 (15:55 +0000)] 
Merge branch '1427-intermittent-failure-in-fetchlimit-system-test' into 'master'

Test for the hard fetchlimit instead of soft fetchlimit

Closes #1427

See merge request isc-projects/bind9!2705

6 years agoTest for the hard fetchlimit instead of soft fetchlimit
Ondřej Surý [Wed, 4 Dec 2019 23:02:43 +0000 (00:02 +0100)] 
Test for the hard fetchlimit instead of soft fetchlimit

Previously, the fetchlimit tested the recursive-clients soft limit
that's defined as 90% of the hard limit (the actual configured value).
This worked previously because the reaping of the oldest recursive
client was put on the same event queue as the current TCP client, thus
the cleaning has happened before the new TCP client established a new
connection.

With the change in BIND 9.14 that added a multiple event queues the
cleaning of the oldests clients is no longer synchronous and could
happen stochastically making the soft limit testing fail often.  The
situation became even worse with the new networking manager, thus we
change the system test to fail only if the hard limit bound is not
honored.

Changing the accounting of the already reaped TCP clients so the soft
limit testing is possible again is out of the scope for this change.

6 years agoMerge branch '1407-intermittent-failure-in-the-mkeys-system-test' into 'master'
Ondřej Surý [Thu, 5 Dec 2019 14:24:29 +0000 (14:24 +0000)] 
Merge branch '1407-intermittent-failure-in-the-mkeys-system-test' into 'master'

Improve the error handling in mkeys test and use retry_quiet()

Closes #1407

See merge request isc-projects/bind9!2704

6 years agoWait for 'all zones loaded' message instead of zoneless 'loaded serial' message
Ondřej Surý [Thu, 5 Dec 2019 13:11:21 +0000 (14:11 +0100)] 
Wait for 'all zones loaded' message instead of zoneless 'loaded serial' message

6 years agoSave all rndc diagnostic output
Ondřej Surý [Wed, 4 Dec 2019 14:56:30 +0000 (15:56 +0100)] 
Save all rndc diagnostic output

6 years agoMake mkeys system test shellcheck clean and run under set -e
Ondřej Surý [Wed, 4 Dec 2019 14:27:13 +0000 (15:27 +0100)] 
Make mkeys system test shellcheck clean and run under set -e

6 years agoImprove the error handling in mkeys test and use retry_quiet()
Ondřej Surý [Wed, 4 Dec 2019 14:06:24 +0000 (15:06 +0100)] 
Improve the error handling in mkeys test and use retry_quiet()

6 years agoMerge branch 'dnssec-keys-rename-to-trust-anchors' into 'master'
Matthijs Mekking [Thu, 5 Dec 2019 13:57:11 +0000 (13:57 +0000)] 
Merge branch 'dnssec-keys-rename-to-trust-anchors' into 'master'

Rename 'dnssec-keys' to 'trust-anchors'

See merge request isc-projects/bind9!2702

6 years agoRename 'dnssec-keys' to 'trust-anchors'
Matthijs Mekking [Wed, 4 Dec 2019 10:06:40 +0000 (11:06 +0100)] 
Rename 'dnssec-keys' to 'trust-anchors'

6 years agoMerge branch '1410-intermittent-failure-in-the-resolver-test' into 'master'
Diego dos Santos Fronza [Wed, 4 Dec 2019 22:58:21 +0000 (22:58 +0000)] 
Merge branch '1410-intermittent-failure-in-the-resolver-test' into 'master'

Resolve "Intermittent failure in the resolver test"

Closes #1410

See merge request isc-projects/bind9!2671

6 years agoImproved prefetch disabled test code
Diego Fronza [Tue, 3 Dec 2019 13:45:39 +0000 (10:45 -0300)] 
Improved prefetch disabled test code

Using retry_quiet to test that prefetch is disabled instead of a
standard loop with sleep 1 between each iteration.

6 years agoFix resolver tests: prefetch 40/41
Diego Fronza [Mon, 2 Dec 2019 22:19:56 +0000 (19:19 -0300)] 
Fix resolver tests: prefetch 40/41

These two tests were failing basically because in order for prefetching to
happen, the TTL for a given DNS record must be greater than or equal to
the prefetch config value + 9.

The previous TTL for both records was 10, while prefetch value in
configuration was 3, thus making only records with TTL >= 12 elligible
for prefetching.

TTL value for both records was adjusted to the value 13, and prefetch
value was set to 4 (inc by 1), so records with TTL (4 + 9) >= 13 are
elligible for prefetching.

Adjusting prefetch value to 4 gives the test 1 second more to avoid time
problems when sharing resources on a heavy loaded PC.

Also prefetch value in settings is now read by the script and used
by it to corrrectly calculate the amount of time needed to delay before
sending a request to trigger prefetch, adding a bit of flexibility to
fine tune the test in the future.

6 years agoFix resolver test: prefetch disabled
Diego Fronza [Fri, 29 Nov 2019 14:53:09 +0000 (11:53 -0300)] 
Fix resolver test: prefetch disabled

The previous test had two problems:
1. It wasn't written specifically for testing what it was supposed to:
prefetch disabled.
2. It could fail in some circunstances if the computer's load is too
high, due to sleeps not taking parallel tests and cpu load into account.

The new test is testing prefetch disabled as follows:
1. It asks for a txt record for a given domain and takes note of the
record's TTL (which is 10).
2. It sleeps for (TTL - 5) = 5 seconds, having a window of 5 seconds to
issue new queries before the record expires from cache.
3. Three(3) queries are executed in a row, with a interval of 1 second
between them, and for each query we verify that the TTL in response is
less than the previous one, thus ensuring that prefetch is disabled (if
it were enabled this record would have been refreshed already and TTL
would be >= the first TTL).

Having a window of 5 seconds to perform 3 queries with a interval of 1
second between them gives the test a reasonable amount of time
to not suffer from a machine with heavy load.

6 years agoMerge branch '1444-deprecate-isc_thread_key-API' into 'master'
Ondřej Surý [Wed, 4 Dec 2019 22:07:54 +0000 (22:07 +0000)] 
Merge branch '1444-deprecate-isc_thread_key-API' into 'master'

Use native compiler Thread Local Storage instead of isc_thread_key API

Closes #1444

See merge request isc-projects/bind9!2680

6 years agoAdd CHANGES
Ondřej Surý [Wed, 4 Dec 2019 21:10:22 +0000 (22:10 +0100)] 
Add CHANGES

6 years agoUpdate PLATFORMS.md to explicitly list Thread Local Storage as requirement for BIND 9
Ondřej Surý [Wed, 4 Dec 2019 05:30:16 +0000 (06:30 +0100)] 
Update PLATFORMS.md to explicitly list Thread Local Storage as requirement for BIND 9

6 years agoRemove isc_thread_key API in favor of ISC_THREAD_LOCAL variables
Ondřej Surý [Mon, 2 Dec 2019 10:42:50 +0000 (11:42 +0100)] 
Remove isc_thread_key API in favor of ISC_THREAD_LOCAL variables

For BIND 9.16+, TLS aware compiler is required, and using
ISC_THREAD_LOCAL is preferred way of using Thread Local Storage.  The
isc_thread_key API is no longer used anywhere and hence was removed from
BIND 9.

6 years agoRefactor the irs_context API to use ISC_THREAD_LOCAL
Ondřej Surý [Mon, 2 Dec 2019 10:42:50 +0000 (11:42 +0100)] 
Refactor the irs_context API to use ISC_THREAD_LOCAL

Previously, the irs_context API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.

6 years agoRefactor the dns_geoip API to use ISC_THREAD_LOCAL
Ondřej Surý [Mon, 2 Dec 2019 10:42:50 +0000 (11:42 +0100)] 
Refactor the dns_geoip API to use ISC_THREAD_LOCAL

Previously, the dns_geoip API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables, and
creating the local memory context was moved to named and stored in the
named_g_geoip global context.

6 years agoRefactor the dns_dt API to use ISC_THREAD_LOCAL
Ondřej Surý [Mon, 2 Dec 2019 10:42:50 +0000 (11:42 +0100)] 
Refactor the dns_dt API to use ISC_THREAD_LOCAL

Previously, the dns_dt API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.

6 years agoRefactor the dns_name API to use ISC_THREAD_LOCAL
Ondřej Surý [Mon, 2 Dec 2019 10:42:50 +0000 (11:42 +0100)] 
Refactor the dns_name API to use ISC_THREAD_LOCAL

Previously, the dns_name API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.

6 years agoAdd and use ISC_THREAD_LOCAL macro
Ondřej Surý [Mon, 2 Dec 2019 10:42:50 +0000 (11:42 +0100)] 
Add and use ISC_THREAD_LOCAL macro

The new ISC_THREAD_LOCAL macro unifies usage of platform dependent
Thread Local Storage definition thread_local vs __thread vs
__declspec(thread) to a single macro.

The commit also unifies the required level of support for TLS as for
some parts of the code it was mandatory and for some parts of the code
it wasn't.

6 years agoMerge branch '1434-explicitly-set-python-to-a-empty-string-with-without-python' into...
Mark Andrews [Tue, 3 Dec 2019 12:48:42 +0000 (12:48 +0000)] 
Merge branch '1434-explicitly-set-python-to-a-empty-string-with-without-python' into 'master'

Resolve "explicitly set PYTHON to a empty string with --without-python"

Closes #1434

See merge request isc-projects/bind9!2672

6 years agoadd AC_ARG_VAR([PYTHON], [path to python executable])
Mark Andrews [Mon, 2 Dec 2019 21:38:50 +0000 (08:38 +1100)] 
add AC_ARG_VAR([PYTHON], [path to python executable])

6 years agoadd CHANGES
Mark Andrews [Sun, 1 Dec 2019 23:25:51 +0000 (10:25 +1100)] 
add CHANGES

6 years agounset PYTHON on --without-python to prevent python still being used
Mark Andrews [Sun, 1 Dec 2019 23:17:44 +0000 (10:17 +1100)] 
unset PYTHON on --without-python to prevent python still being used

6 years agoMerge branch '1419-threadsanitizer-data-race-rbtdb-c-7568-in-issecure' into 'master'
Mark Andrews [Tue, 3 Dec 2019 01:14:27 +0000 (01:14 +0000)] 
Merge branch '1419-threadsanitizer-data-race-rbtdb-c-7568-in-issecure' into 'master'

Resolve "ThreadSanitizer: data race rbtdb.c:7568 in issecure"

Closes #1419

See merge request isc-projects/bind9!2656

6 years agor/w of rbtdb->current_version requires that rbtdb->lock be held
Mark Andrews [Thu, 28 Nov 2019 06:58:40 +0000 (17:58 +1100)] 
r/w of rbtdb->current_version requires that rbtdb->lock be held

6 years agoMerge branch '1412-threadsanitizer-data-race-resolver-c-7030-in-fctx_decreference...
Mark Andrews [Mon, 2 Dec 2019 23:46:16 +0000 (23:46 +0000)] 
Merge branch '1412-threadsanitizer-data-race-resolver-c-7030-in-fctx_decreference-2' into 'master'

Resolve "ThreadSanitizer: data race resolver.c:7030 in fctx_decreference"

Closes #1412

See merge request isc-projects/bind9!2673

6 years agoMake fctx->attributes atomic.
Mark Andrews [Mon, 2 Dec 2019 04:11:50 +0000 (15:11 +1100)] 
Make fctx->attributes atomic.

FCTX_ATTR_SHUTTINGDOWN needs to be set and tested while holding the node
lock but the rest of the attributes don't as they are task locked. Making
fctx->attributes atomic allows both behaviours without races.

6 years agoMerge branch 'michal/address-asan-memory-leak-reports' into 'master'
Michał Kępień [Mon, 2 Dec 2019 15:07:45 +0000 (15:07 +0000)] 
Merge branch 'michal/address-asan-memory-leak-reports' into 'master'

Address ASAN memory leak reports

See merge request isc-projects/bind9!2679

6 years agoDo not define ASAN_OPTIONS at build time
Michał Kępień [Mon, 2 Dec 2019 15:03:23 +0000 (16:03 +0100)] 
Do not define ASAN_OPTIONS at build time

Disabling ASAN memory leak detection for a build job is pointless
because ASAN is only used in test jobs.  (Also, memory leak detection
should not be disabled globally - explicit suppressions should be used
in case of issues with external code.)

6 years agoMove xmlInitThreads()/xmlCleanupThreads() calls
Michał Kępień [Mon, 2 Dec 2019 15:03:23 +0000 (16:03 +0100)] 
Move xmlInitThreads()/xmlCleanupThreads() calls

xmlInitThreads() and xmlCleanupThreads() are called from within
named_statschannels_configure() and named_statschannels_shutdown(),
respectively.  Both of these functions are executed by worker threads,
not the main named thread.  This causes ASAN to report memory leaks like
the following one upon shutdown (as long as named is asked to produce
any XML output over its configured statistics channels during its
lifetime):

    Direct leak of 968 byte(s) in 1 object(s) allocated from:
        #0 0x7f677c249cd8 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:153
        #1 0x7f677bc1838f in xmlGetGlobalState (/usr/lib/libxml2.so.2+0xa838f)

The data mentioned in the above report is a libxml2 state structure
stored as thread-specific data.  Such chunks of memory are automatically
released (by a destructor passed to pthread_key_create() by libxml2)
whenever a thread that allocated a given chunk exits.  However, if
xmlCleanupThreads() is called by a given thread before it exits, the
destructor will not be invoked (due to xmlCleanupThreads() calling
pthread_key_delete()) and ASAN will report a memory leak.  Thus,
xmlInitThreads() and xmlCleanupThreads() must not be called from worker
threads.  Since xmlInitThreads() must be called on Windows in order for
libxml2 to work at all, move xmlInitThreads() and xmlCleanupThreads()
calls to the main named thread (which does not produce any XML output
itself) in order to prevent the memory leak from being reported by ASAN.

6 years agoMerge branch '1445-fix-geoip2-memory-leak-upon-reconfiguration' into 'master'
Michał Kępień [Mon, 2 Dec 2019 14:54:42 +0000 (14:54 +0000)] 
Merge branch '1445-fix-geoip2-memory-leak-upon-reconfiguration' into 'master'

Fix GeoIP2 memory leak upon reconfiguration

Closes #1445

See merge request isc-projects/bind9!2678

6 years agoAdd CHANGES entry
Michał Kępień [Mon, 2 Dec 2019 14:15:06 +0000 (15:15 +0100)] 
Add CHANGES entry

5329. [bug] Reconfiguring named caused memory to be leaked when any
GeoIP2 database was in use. [GL #1445]

6 years agoFix GeoIP2 memory leak upon reconfiguration
Michał Kępień [Mon, 2 Dec 2019 14:15:06 +0000 (15:15 +0100)] 
Fix GeoIP2 memory leak upon reconfiguration

Loaded GeoIP2 databases are only released when named is shut down, but
not during server reconfiguration.  This causes memory to be leaked
every time "rndc reconfig" or "rndc reload" is used, as long as any
GeoIP2 database is in use.  Fix by releasing any loaded GeoIP2 databases
before reloading them.  Do not call dns_geoip_shutdown() until server
shutdown as that function releases the memory context used for caching
GeoIP2 lookup results.

6 years agoMerge branch '1416-threadsanitizer-data-race-resolver-c-3384-in-findname' into 'master'
Ondřej Surý [Mon, 2 Dec 2019 08:49:15 +0000 (08:49 +0000)] 
Merge branch '1416-threadsanitizer-data-race-resolver-c-3384-in-findname' into 'master'

Resolve "ThreadSanitizer: data race resolver.c:3384 in findname"

Closes #1416

See merge request isc-projects/bind9!2668

6 years agoAssign fctx->client when fctx is created rather when the join happens.
Mark Andrews [Thu, 28 Nov 2019 22:59:03 +0000 (09:59 +1100)] 
Assign fctx->client when fctx is created rather when the join happens.

This prevents races on fctx->client whenever a new fetch joins a existing
fetch (by calling fctx_join) as it is now invariant for the active life of
fctx.

6 years agoMerge branch '1293-change-the-return-value-for-dns_name_dup-to-void-and-cleanup-the...
Ondřej Surý [Fri, 29 Nov 2019 13:40:54 +0000 (13:40 +0000)] 
Merge branch '1293-change-the-return-value-for-dns_name_dup-to-void-and-cleanup-the-code' into 'master'

Change the return value for dns_name_dup() to void and cleanup the code

Closes #1293

See merge request isc-projects/bind9!2518

6 years agoDisable no longer useful semantic patches
Ondřej Surý [Fri, 29 Nov 2019 13:03:29 +0000 (14:03 +0100)] 
Disable no longer useful semantic patches

Some semantic patches are meant to be run just once, as they work on
functions with changed prototypes. We keep them for reference, but
disabled them from the CI to save time.

6 years agoRefactor dns_name_dup() usage using the semantic patch
Ondřej Surý [Fri, 1 Nov 2019 13:31:13 +0000 (08:31 -0500)] 
Refactor dns_name_dup() usage using the semantic patch

6 years agococci: Add semantic patch to refactor dns_name_dup() usage
Ondřej Surý [Fri, 1 Nov 2019 13:30:32 +0000 (08:30 -0500)] 
cocci: Add semantic patch to refactor dns_name_dup() usage

6 years agolibdns: dns_name_dup() can't fail, change return type to void
Ondřej Surý [Fri, 1 Nov 2019 13:24:35 +0000 (08:24 -0500)] 
libdns: dns_name_dup() can't fail, change return type to void

6 years agoMerge branch '1430-fix-logging-long-named-command-lines' into 'master'
Michał Kępień [Fri, 29 Nov 2019 08:07:47 +0000 (08:07 +0000)] 
Merge branch '1430-fix-logging-long-named-command-lines' into 'master'

Fix logging long named command lines

Closes #1430

See merge request isc-projects/bind9!2667

6 years agoFix logging long named command lines
Michał Kępień [Fri, 29 Nov 2019 08:06:41 +0000 (09:06 +0100)] 
Fix logging long named command lines

The saved_command_line buffer in bin/named/main.c is 8192 bytes long.
The size of libisc's internal logging buffer (defined by the value of
the LOG_BUFFER_SIZE constant in lib/isc/log.c) is also 8192 bytes.
Since the buffer containing the ellipsis is passed as the last argument
to isc_log_write() and the buffer containing the potentially trimmed
named command line (saved_command_line) is passed as the second argument
in the same isc_log_write() call, it may happen that saved_command_line
will exhaust all available space in libisc's internal logging buffer, in
which case the ellipsis will be elided from the output.

Make saved_command_line 4096 bytes long as that value is arguably also
large enough for any reasonable use case and at the same time it ensures
ellipsis will always be printed for excessively long named command
lines.

6 years agoMerge branch '1310-improve-portability-of-the-runtime-system-test' into 'master'
Michał Kępień [Fri, 29 Nov 2019 07:48:08 +0000 (07:48 +0000)] 
Merge branch '1310-improve-portability-of-the-runtime-system-test' into 'master'

Improve portability of the "runtime" system test

Closes #1310

See merge request isc-projects/bind9!2666

6 years agoImprove portability of the "runtime" system test
Michał Kępień [Fri, 29 Nov 2019 07:47:33 +0000 (08:47 +0100)] 
Improve portability of the "runtime" system test

The "runtime" system test currently fails on Windows because it waits
for named to log a message indicating successful startup ("running"),
but that never happens since named on Windows fails to open the
configuration file as its path includes control characters.

Instead of putting control characters in directory names, put them in
the value of the -D command line switch passed to named, which is used
for identifying an instance of named in a process listing and whose
value is completely ignored by named, but still logged.

While a similar check using special characters appears to be working
fine on Windows for the time being, modify it in the same way to avoid
potential future problems on other platforms and make the test cleaner.

6 years agoMerge branch '1431-summary-sanitizer-grep-is-dangerous' into 'master'
Ondřej Surý [Fri, 29 Nov 2019 07:02:30 +0000 (07:02 +0000)] 
Merge branch '1431-summary-sanitizer-grep-is-dangerous' into 'master'

Resolve ""SUMMARY: .*Sanitizer" grep is dangerous"

Closes #1431

See merge request isc-projects/bind9!2669

6 years agoreplace grep -r with 'find -type f | xargs'
Mark Andrews [Thu, 28 Nov 2019 23:58:28 +0000 (10:58 +1100)] 
replace grep -r with 'find -type f | xargs'

6 years agoMerge branch 'ondrej/keep-sanitizer-tainted-system-tests-files' into 'master'
Ondřej Surý [Thu, 28 Nov 2019 21:39:28 +0000 (21:39 +0000)] 
Merge branch 'ondrej/keep-sanitizer-tainted-system-tests-files' into 'master'

Don't clean the system test temporary files if sanitizer reports were found inside

See merge request isc-projects/bind9!2657

6 years agoDon't clean the system test temporary files if sanitizer reports were found inside
Ondřej Surý [Tue, 26 Nov 2019 17:03:33 +0000 (18:03 +0100)] 
Don't clean the system test temporary files if sanitizer reports were found inside

6 years agoMerge branch '1417-threadsanitizer-data-race-rbtdb-c-1535-in-add32' into 'master'
Mark Andrews [Thu, 28 Nov 2019 20:10:33 +0000 (20:10 +0000)] 
Merge branch '1417-threadsanitizer-data-race-rbtdb-c-1535-in-add32' into 'master'

Resolve "ThreadSanitizer: data race rbtdb.c:1535 in add32"

Closes #1417

See merge request isc-projects/bind9!2655

6 years agoadd CHANGES
Mark Andrews [Wed, 27 Nov 2019 23:28:31 +0000 (10:28 +1100)] 
add CHANGES

6 years agordataset_setownercase and rdataset_getownercase need to obtain a node lock
Mark Andrews [Wed, 27 Nov 2019 23:24:12 +0000 (10:24 +1100)] 
rdataset_setownercase and rdataset_getownercase need to obtain a node lock

6 years agoMerge branch 'ondrej/stop-retrying-system-tests' into 'master'
Ondřej Surý [Thu, 28 Nov 2019 12:22:59 +0000 (12:22 +0000)] 
Merge branch 'ondrej/stop-retrying-system-tests' into 'master'

Stop retrying the system tests; we should fix the tests instead

See merge request isc-projects/bind9!2649

6 years agoMerge branch 'wpk/clock-realtime-fast' into 'master'
Ondřej Surý [Thu, 28 Nov 2019 12:07:37 +0000 (12:07 +0000)] 
Merge branch 'wpk/clock-realtime-fast' into 'master'

Use clock_realtime_fast where available

See merge request isc-projects/bind9!2661

6 years agoStop retrying the system tests; we should fix the tests instead
Ondřej Surý [Tue, 26 Nov 2019 12:00:32 +0000 (13:00 +0100)] 
Stop retrying the system tests; we should fix the tests instead