Commit graph

29857 commits

Author SHA1 Message Date
Michal Nowak
fde281f653 Update GitLab CI to Fedora 31
Since Fedora 31 is the current Fedora release, replace Fedora 30 GitLab
CI jobs with their up-to-date counterparts.

(cherry picked from commit b36f5496237f0dbb84d7541140e87d7da475cd36)
2019-12-11 16:33:33 +00:00
Michał Kępień
56e54fb201 Merge branch 'michal/create-release-tarballs-in-gitlab-ci-v9_14' into 'v9_14'
[v9_14] Create release tarballs in GitLab CI

See merge request isc-projects/bind9!2752
2019-12-11 12:31:13 +00:00
Michał Kępień
7e13a1f7e9 Add a job creating a release tarball to GitLab CI
Add a GitLab CI job (which is run only if all other jobs in a pipeline
succeed) that builds a BIND release tarball, i.e. fetches the source
tarball from the tarball building job, creates Windows zips, puts
certain parts of BIND documentation into the appropriate places, and
packs it all up into a single tarball whose contents can be subsequently
signed and published.

(cherry picked from commit 5a4a6b5e91)
2019-12-11 12:26:48 +01:00
Michał Kępień
7c586d3ac6 Add a Windows debug system test job to GitLab CI
Add a system test job for binaries created by Visual Studio in the
"Debug" build configuration to GitLab CI so that they can be tested
along their "Release" counterparts when necessary.

(cherry picked from commit 2b1c8c54d1)
2019-12-11 12:26:37 +01:00
Michał Kępień
01598c5c2a Add a Windows debug build job to GitLab CI
Add a Visual Studio build job using the "Debug" build configuration to
GitLab CI without enabling it for every pipeline as it takes about twice
as long to complete as its "Release" counterpart.

(cherry picked from commit 12564928a7)
2019-12-11 12:26:11 +01:00
Michał Kępień
d1b120d3bd Create and test BIND source tarballs in GitLab CI
Add a set of jobs to GitLab CI that create a BIND source tarball and
then build and test its contents.  Run those extra jobs only when a tag
is pushed to the Git repository as they are only meant to be sanity
checks of BIND source tarball contents.

(cherry picked from commit 8d56749046)
2019-12-11 12:24:17 +01:00
Michał Kępień
f60cd0c730 Include prepare-softhsm2.sh in source tarballs
The util/prepare-softhsm2.sh script is useful for initializing a working
SoftHSM environment which can be used by unit tests and system tests.
However, since it is a test-specific script, it does not really belong
in the util/ subdirectory which is mostly pruned during the BIND source
tarball creation process.  Move the prepare-softhsm2.sh script to
bin/tests/ so that its location is more appropriate for its purpose and
also so that it does not get removed during the BIND source tarball
creation process, allowing it to be used for setting up test
environments for tarball-based builds.

(cherry picked from commit c0be772ebc)
2019-12-11 12:23:20 +01:00
Michał Kępień
89cccc53ba List paths which should be excluded from tarballs
Convert the logic (currently present in the form of "rm -rf" calls in
util/kit.sh) for removing files and directories which are tracked by Git
but redundant in release tarballs into a set of .gitattributes rules
which allow the same effect to be achieved using "git archive".

(cherry picked from commit 925ecb0aae)
2019-12-11 12:22:14 +01:00
Mark Andrews
872462fe7b Merge branch '1411-threadsanitizer-data-race-resolver-c-2153-in-fctx_query-v9_14' into 'v9_14'
Resolve "ThreadSanitizer: data race resolver.c:2153 in fctx_query"

See merge request isc-projects/bind9!2748
2019-12-11 00:35:59 +00:00
Mark Andrews
e40c1582d6 Note bucket lock requirements and move REQUIRE inside locked section.
(cherry picked from commit 13aaeaa06f)
2019-12-11 11:01:59 +11:00
Mark Andrews
0de313fff7 lock access to fctx->nqueries
(cherry picked from commit 5589748eca)
2019-12-11 11:01:59 +11:00
Mark Andrews
bd6a5a9993 Merge branch '1441-threadsanitizer-lock-order-inversion-potential-deadlock-usr-lib-x86_64-linux-gnu-libtsan-so-0-v9_14' into 'v9_14'
address deadlock introduced in cd2469d3cd

See merge request isc-projects/bind9!2743
2019-12-10 13:04:22 +00:00
Mark Andrews
8bd8ed26ed address deadlock introduced in cd2469d3cd
(cherry picked from commit fd52417f71)
2019-12-10 23:38:53 +11:00
Michał Kępień
7242c4fbd7 Merge branch '1465-fix-idna-system-test-v9_14' into 'v9_14'
[v9_14] Fix the "idna" system test

See merge request isc-projects/bind9!2741
2019-12-10 11:28:43 +00:00
Michał Kępień
7c14f67d74 Only use LC_ALL=C where intended
The LC_ALL=C assignments in the "idna" system test, which were only
meant to affect a certain subset of checks, in fact persist throughout
all the subsequent checks in that system test.  That affects the test's
behavior and is misleading.

When the "VARIABLE=value command ..." syntax is used in a shell script,
in order for the variable assignment to only apply to "command", the
latter must be an external binary; otherwise, the VARIABLE=value
assignment persists for all subsequent commands in a script:

    $ cat foo.sh
    #!/bin/sh

    foo() {
        /bin/sh bar.sh
    }

    BAR="baz0"
    BAR="baz1" /bin/sh bar.sh
    echo "foo: BAR=${BAR}"
    BAR="baz2" foo
    echo "foo: BAR=${BAR}"

    $ cat bar.sh
    #!/bin/sh

    echo "bar: BAR=${BAR}"

    $ /bin/sh foo.sh
    bar: BAR=baz1
    foo: BAR=baz0
    bar: BAR=baz2
    foo: BAR=baz2
    $

Fix by saving the value of LC_ALL before the relevant set of checks in
the "idna" system test, restoring it afterwards, and dropping the
"LC_ALL=C command ..." syntax.

(cherry picked from commit 2ee7ff23ce)
2019-12-10 11:57:57 +01:00
Matthijs Mekking
18d314fa64 Merge branch '1457-intermittent-failure-autosign-v9_14' into 'v9_14'
Resolve "Intermittent failure in the autosign system test"

See merge request isc-projects/bind9!2732
2019-12-09 15:30:27 +00:00
Matthijs Mekking
6658c11251 Better error handling in autosign system test
(cherry picked from commit bd4035900a)
2019-12-09 16:01:53 +01:00
Matthijs Mekking
fb0ddd5bfe 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.

(cherry picked from commit 2e4273b55a)
2019-12-09 15:53:02 +01:00
Matthijs Mekking
5d6fad9e1e Introduce wait_for_log in autosign test 2019-12-09 15:52:00 +01:00
Matthijs Mekking
440732acd7 Save settime output
(cherry picked from commit 6b4a17ef7c)
2019-12-09 15:45:11 +01:00
Michał Kępień
fdccea0896 Merge branch '1452-system-test-framework-cleanup-tweaks-v9_14' into 'v9_14'
[v9_14] System test framework: cleanup tweaks

See merge request isc-projects/bind9!2721
2019-12-06 13:48:53 +00:00
Michał Kępień
5f82122ffa 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.

(cherry picked from commit d8905b7a9c)
2019-12-06 14:47:08 +01:00
Michał Kępień
3f7658bda7 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.

(cherry picked from commit bf3eeac067)
2019-12-06 14:47:08 +01:00
Michał Kępień
9a60296b84 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.

(cherry picked from commit b4d37878f6)
2019-12-06 14:47:08 +01:00
Michał Kępień
38a4bedfcd 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).

(cherry picked from commit b0916bba41)
2019-12-06 14:47:08 +01:00
Michał Kępień
8ed6c8fd59 Merge branch '1452-detect-missing-system-test-results-v9_14' into 'v9_14'
[v9_14] Detect missing system test results

See merge request isc-projects/bind9!2720
2019-12-06 13:46:31 +00:00
Michał Kępień
19cd59923c 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.

(cherry picked from commit 3c3085be3c)
2019-12-06 14:19:55 +01:00
Mark Andrews
1b0845a182 Merge branch '1455-job-failed-453300-v9_14' into 'v9_14'
loop waiting for the redirect zone to load

See merge request isc-projects/bind9!2713
2019-12-06 00:19:40 +00:00
Mark Andrews
a47736abb0 loop waiting for the redirect zone to load
(cherry picked from commit e4b1d0b686)
2019-12-06 10:57:16 +11:00
Mark Andrews
c480706290 Merge branch '1434-explicitly-set-python-to-a-empty-string-with-without-python-v9_14' into 'v9_14'
Resolve "explicitly set PYTHON to a empty string with --without-python"

See merge request isc-projects/bind9!2696
2019-12-03 13:32:47 +00:00
Mark Andrews
eab8463f42 add AC_ARG_VAR([PYTHON], [path to python executable])
(cherry picked from commit eed2aabc40)
2019-12-03 23:51:09 +11:00
Mark Andrews
4c257570d6 add CHANGES
(cherry picked from commit 8cd3cf90b2)
2019-12-03 23:51:09 +11:00
Mark Andrews
a53231a274 unset PYTHON on --without-python to prevent python still being used
(cherry picked from commit d8fc544569)
2019-12-03 23:51:09 +11:00
Mark Andrews
62f0b06637 Merge branch '1419-threadsanitizer-data-race-rbtdb-c-7568-in-issecure-v9_14' into 'v9_14'
r/w of rbtdb->current_version requires that rbtdb->lock be held

See merge request isc-projects/bind9!2692
2019-12-03 12:16:00 +00:00
Mark Andrews
e9704327c4 r/w of rbtdb->current_version requires that rbtdb->lock be held
(cherry picked from commit cd2469d3cd)
2019-12-03 09:09:52 +00:00
Mark Andrews
08a60bdd92 Merge branch '1416-threadsanitizer-data-race-resolver-c-3384-in-findname-v9_14' into 'v9_14'
Assign fctx->client when fctx is created rather when the join happens.

See merge request isc-projects/bind9!2694
2019-12-03 06:20:50 +00:00
Mark Andrews
d0796289dc 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.

(cherry picked from commit 9ca6ad6311)
2019-12-03 17:00:02 +11:00
Mark Andrews
90712110e3 Merge branch '1412-threadsanitizer-data-race-resolver-c-7030-in-fctx_decreference-2-v9_14' into 'v9_14'
Make fctx->attributes atomic.

See merge request isc-projects/bind9!2690
2019-12-03 01:34:36 +00:00
Mark Andrews
7e66602cd6 back port atomic and / or support 2019-12-03 11:38:06 +11:00
Mark Andrews
c712f40676 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.

(cherry picked from commit 912ce87479)
2019-12-03 10:52:02 +11:00
Michał Kępień
0f2a8e259d Merge branch 'michal/address-asan-memory-leak-reports-v9_14' into 'v9_14'
[v9_14] Address ASAN memory leak reports

See merge request isc-projects/bind9!2683
2019-12-02 18:24:42 +00:00
Michał Kępień
1313f06110 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.

(cherry picked from commit b425b5d56e)
2019-12-02 17:09:39 +01:00
Michał Kępień
7a5c7f2ba7 Merge branch '1445-fix-geoip2-memory-leak-upon-reconfiguration-v9_14' into 'v9_14'
[v9_14] Fix GeoIP2 memory leak upon reconfiguration

See merge request isc-projects/bind9!2681
2019-12-02 16:07:29 +00:00
Michał Kępień
b109666c94 Add CHANGES entry
5329.	[bug]		Reconfiguring named caused memory to be leaked when any
			GeoIP2 database was in use. [GL #1445]

(cherry picked from commit 628b1837d2)
2019-12-02 15:27:15 +01:00
Michał Kępień
5a0582f3e7 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.

(cherry picked from commit 670afbe84a)
2019-12-02 15:21:38 +01:00
Mark Andrews
29b40677b0 Merge branch '1417-threadsanitizer-data-race-rbtdb-c-1535-in-add32-v9_14' into 'v9_14'
Resolve "ThreadSanitizer: data race rbtdb.c:1535 in add32"

See merge request isc-projects/bind9!2664
2019-11-28 21:55:22 +00:00
Mark Andrews
049b5e0dcc add CHANGES
(cherry picked from commit 68693f8279)
2019-11-29 07:12:44 +11:00
Mark Andrews
1a7b62916c rdataset_setownercase and rdataset_getownercase need to obtain a node lock
(cherry picked from commit 637b2c4e51)
2019-11-29 07:12:44 +11:00
Ondřej Surý
36e5f50ee8 Merge branch 'mnowak/runtime-forward-port-softhsm2-setup-9_14' into 'v9_14'
[9.14] Fix the UID switch test to work with PKCS#11 build

See merge request isc-projects/bind9!2653
2019-11-27 17:14:53 +00:00
Michal Nowak
271c836a86 Fix the UID switch test to work with PKCS#11 build
Forward port of 32fe9a0051fc76be4657fc2742e71d2be6193011 by Ondřej Surý.

(cherry picked from commit c49c41a1adb9fa8ae75fe656692d9935de1d505f)
2019-11-27 17:14:53 +00:00