2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 13:08:06 +00:00

2727 Commits

Author SHA1 Message Date
Aydın Mercan
7d5928c3a2
add isc/bit.h and unify common bit operations
The `<isc/bit.h>` header is a GNU C11 compatible version of C23's
`<stdbit.h>`.

It currently uses either `<stdbit.h>` or the equivilent compiler
builtins. However, the generic `__builtin_ctzg` and `__builtin_ctlz`
builtins are not available in every compiler version and thus falls
back to manually selecting from type.

Furthermore, the ctz fallback has been removed since `__builtin_ctzll`
has been used for a while directly without any compilation issues from
users. Thus, we can also require `__builtin_ctz`.

Unlike the rest of C23's bit utilities, we avoid the stdc_rotate_*
functions since we don't need the rotation modulus precision. This adds
a couple (admittedly cheap) unwanted instructions on some architectures.
2025-08-19 11:52:12 +03:00
Štěpán Balážik
0dcb95391f Remove util/git-replay-merge.sh
This is superceded by the auto-backport scripts in bind9-qa repo.
2025-07-17 07:17:12 +02:00
Štěpán Balážik
3e4e6c11b8 Remove obsolete include checks
These will not pass on today's code anyway.
2025-07-17 07:17:12 +02:00
Štěpán Balážik
d536de1db1 Remove util/nanny.pl and contrib/scripts/nanny.pl
I doubt that anyone is using it after 25 years.
2025-07-17 07:17:12 +02:00
Michał Kępień
25e0fade1c
Do not hardcode release date in man pages
The util/meson-dist-package.sh script hardcodes the date it is run on
into the man pages it creates in the dist tarball.  This causes pkgdiff
to report discrepancies if the util/release-tarball-comparison.sh script
is run on a different day than the one the dist tarball was generated
on.

Fix by using the exact same solution as in BIND 9.20: generating the man
page stubs with a @RELEASE_DATE@ placeholder instead of a specific date
and only replacing that placeholder with a specific date during the
build process.
2025-07-10 11:20:46 +02:00
Aydın Mercan
206d52b727
do not install manpages for unbuilt binaries
Building and installing from a git release installed all manpages
unconditionally even if binaries like dnstap-read were disabled and not
built.

Now the manpage configuration checks for such cases and also cleans up
remaining artifacts and unnecessary pages if the build directory is
reconfigured.
2025-06-30 11:58:13 +03:00
Michal Nowak
055bc118eb Add meson support to util/release-tarball-comparison.sh 2025-06-25 12:48:13 +02:00
Michal Nowak
54ea6722e5 Create "srcid" file as part of release tarball
Change the name of the source ID file to what we used to deliver.
2025-06-24 17:00:05 +02:00
Michał Kępień
4f7f420534
Move "stress" test generation script to QA repo
Move the util/generate-stress-test-configs.py script from the BIND 9
source repository to the BIND 9 QA repository.  This simplifies the
maintenance of that script by eliminating the need to backport every
change applied to it to multiple branches.
2025-06-21 06:43:36 +02:00
Aydın Mercan
5cd6c173ff
replace the build system with meson
Meson is a modern build system that has seen a rise in adoption and some
version of it is available in almost every platform supported.

Compared to automake, meson has the following advantages:

* Meson provides a significant boost to the build and configuration time
  by better exploiting parallelism.

* Meson is subjectively considered to be better in readability.

These merits alone justify experimenting with meson as a way of
improving development time and ergonomics. However, there are some
compromises to ensure the transition goes relatively smooth:

* The system tests currently rely on various files within the source
  directory. Changing this requirement is a non-trivial task that can't
  be currently justified. Currently the last compiled build directory
  writes into the source tree which is in turn used by pytest.

* The minimum version supported has been fixed at 0.61. Increasing this
  value will require choosing a baseline of distributions that can
  package with meson. On the contrary, there will likely be an attempt
  to decrease this value to ensure almost universal support for building
  BIND 9 with meson.
2025-06-11 10:30:12 +03:00
Michal Nowak
dcccfb4cf8
Add Fedora 42 2025-04-16 20:18:00 +02:00
Ondřej Surý
1fae6ccea1
Add the call function tracking to isc_mem API
As we already track __func__, __FILE__, __LINE__ triplet in most places,
add the function tracking to the isc_mem tracking API.
2025-03-05 11:17:17 +01:00
Michal Nowak
e0df774ca0 Move FreeBSD jobs to AWS autoscalers
From technical reasons --with-readline=libedit is not being tested on
FreeBSD anymore as it's hard to have anchors both unified and specific.
2025-03-05 09:25:21 +00:00
Michal Nowak
6e2272d769
No need to delete the "only" keyword in generate-tsan-stress-jobs.py
29fd7564083731373bd132ec65ffc0a9072f8efc replaced "only" with "rules" in
.gitlab-ci.yml but forgot to drop the removal from here, hence the
script was broken.
2025-02-28 09:01:46 +01:00
Nicki Křížek
4214c1e8a7 Run shotgun tests on MRs
If the shotgun tests are executed for MRs, compare it against the MR's
base rather than the previous release. Only fail the job in case the
performance drops (pass on performance improvements).

Note that start_in optimization was removed, since it isn't properly
supported with rules as of February 2025
(https://gitlab.com/gitlab-org/gitlab/-/issues/424203). Without this
optimization, container test images are likely to be re-built
unnecessarily when testing different protocols. A workaround for the
.gitlab-ci.yml exists, but the extra complexity doesn't seem justified.
The container image builds might change or be optimized in the future,
so let's just go with the build duplication for now.
2025-02-27 14:26:38 +01:00
Michal Nowak
a03c4b4cf9 Generate TSAN unit stress tests 2025-02-13 16:39:27 +00:00
Michal Nowak
dab7d28b09
Do not evaluate $CI_PROJECT_DIR in generate-stress-test-configs.py
GitLab CI Runner's $builds_dir variable is set to "/builds" by default.
For technical reasons, the FreeBSD Runners, using the "instance"
executor, sets the path differently.

The value of $CI_PROJECT_DIR is based on $builds_dir, so if the
generate-stress-test-configs.py script generates jobs with
$CI_PROJECT_DIR (or variables like $INSTALL_PATH that are based on it)
evaluated, it is calcified to whatever was the value in the particular
environment, disregarding the FreeBSD "instance" executor specifics in
the child pipeline.

Instead of evaluating $CI_PROJECT_DIR in the script, evaluate it in the
runtime environment.
2025-02-05 15:46:14 +01:00
Michal Nowak
9756292a5f
Add DoH and DoT stress tests, generate test configurations
Add DoH and DoT stress test jobs. The DoH scenario on FreeBSD is omitted
because all Flamethrower's DoH queries timeout on this platform.

Since the response rate of DoT queries is lower than that of DoH and
TCP, the expected TCP response rate is 80%.

Due to the large number of similar stress test configurations, the
"util/generate-stress-test-configs.py" script now generates them as part
of a downstream pipeline. The script is expected to be run exclusively
within the CI environment, which sources all environmental variables and
files.

This refactoring brought the following changes:

- To start a stress test immediately and not wait for artifacts of the
  autoreconf job, run the "autoreconf -fi" command as part of every job.

- Drop the BIND_STRESS_TEST_* variables as they were rarely used and
  conflicted with mode and platform selection in the configuration
  generator.

- Most pipelines now include a few short, randomly selected stress test
  jobs. To schedule all stress tests, set the ALL_BIND_STRESS_TESTS
  environmental variable, push a tag to CI, or run a scheduled pipeline.

- Set the BIND_STRESS_TESTS_RUN_TIME environmental variable to pick the
  stress test runtime of your choosing, set the BIND_STRESS_TESTS_RATE
  environmental variable to set different than the default query rate.

- Job timeout is set to 30 minutes plus stress test runtime in minutes.
2025-01-27 16:17:39 +01:00
Ondřej Surý
06f9163d51
Remove C++ support from the public header
Since BIND 9 headers are not longer public, there's no reason to keep
the ISC_LANG_BEGINDECL and ISC_LANG_ENDDECL macros to support including
them from C++ projects.
2024-12-18 13:10:39 +01:00
Ondřej Surý
0258850f20
Remove redundant parentheses from the return statement 2024-11-19 12:27:22 +01:00
Mark Andrews
ac1c60d87e Add send-report-channel option
This commit adds support for the EDNS Report-Channel option,
which is returned in authoritative responses when EDNS is in use.

"send-report-channel" sets the Agent-Domain value that will be
included in EDNS Report-Channel options.  This is configurable at
the options/view level; the value is a DNS name. Setting the
Agent-Domain to the root zone (".") disables the option.

When this value has been set, incoming queries matchng the form
_er.<qtype>.<qname>.<extended-error-code>._er.<agent-domain>/TXT
will be logged to the dns-reporting-agent channel at INFO level.

(Note: error reporting queries will only be accepted if sent via
TCP or with a good server cookie.  If neither is present, named
returns BADCOOKIE to complete the DNS COOKIE handshake, or TC=1
to switch the client to TCP.)
2024-10-23 21:29:32 +00:00
Nicki Křížek
7639c58c48 Disable too-many/too-few pylint checks
Enforcing pylint standards and default for our test code seems
counter-productive. Since most of the newly added code are tests or is
test-related, encountering these checks rarely make us refactor the code
in other ways and we just disable these checks individually. Code that
is too complex or convoluted will be pointed out in reviews anyways.
2024-10-17 11:01:44 +02:00
Michal Nowak
0dd154648e
Add libjson-c-dev before #4960 is addressed
Otherwise the "statistics-channels" option in doc/misc/options and
doc/man/named.conf.5in is marked as "not configured" (contrary to what
we have in release tarballs as they were build on a different image that
has libjson-c and libxml2 in it).

Caused by #4895 that made the option dependant on libjson-c or libxml2
presence in the build image.
2024-10-14 18:52:45 +02:00
Michal Nowak
b926488de8
Always use requirements.txt from main
Instances of the requirements.txt file may be outdated in other
branches.
2024-10-14 18:52:45 +02:00
Michal Nowak
83357e4d3c
Drop BIND 9.16 support 2024-10-14 18:52:45 +02:00
Nicki Křížek
3b227e1161 Increase shotgun pipeline timeout
When running shotgun tests on tagged releases, the increased number of
jobs may cause the shotgun pipeline to take longer than 50 minutes to
finish.
2024-10-14 10:41:39 +02:00
Mark Andrews
5fad79c92f Log the rcode returned to for a query
Log to the querylog the rcode of a previous query using
the identifier 'response:' to diffenciate queries from
responses.
2024-09-19 21:44:06 +00:00
Michal Nowak
338d4c8dd3
Generate TSAN stress test 2024-08-28 11:01:11 +02:00
Ondřej Surý
091d738c72 Convert all categories and modules into static lists
Remove the complicated mechanism that could be (in theory) used by
external libraries to register new categories and modules with
statically defined lists in <isc/log.h>.  This is similar to what we
have done for <isc/result.h> result codes.  All the libraries are now
internal to BIND 9, so we don't need to provide a mechanism to register
extra categories and modules.
2024-08-20 12:50:39 +00:00
Nicki Křížek
3f1a843695
Remove changes job and related scripts
These are no longer needed, since changelog is generated using
gitchangelog.
2024-07-29 13:03:20 +02:00
Aydın Mercan
ca9a05f9ce Check for atomic operations consistency in checklibs.sh
isc/atomic.h and its defined macros should be preferred over
stdatomic.h and explicit atomic operations.

Fix the redundant stdatomic.h header in histo.c found by the introduced
check.
2024-01-03 17:04:31 +00:00
Tom Krizek
ff32421a64
util: script to get DNS Shotgun pipeline results
The shotgun performance tests are executed in a different repository, in
a couple of different pipelines. To hide away the complexity, this
script takes the pipeline ID of the triggered pipeline and then takes
care of the rest - waits for the pipeline to finish, locates the child
pipeline and the relevant results. The output from this script is a
convenient link to the charts with the results once they're available.

GitLab also has a mechanism which can wait for another pipeline.
However, it can't be utilized here, since there are variables which
need to be passed in when the pipeline is triggered (like protocol to be
tested, load, runtime etc.). This isn't currently supported by the
GitLab feature.
2023-11-01 09:47:20 +01:00
Ondřej Surý
f8e264ba6d
Remove the lock-file configuration and -X argument to named
The lock-file configuration (both from configuration file and -X
argument to named) has better alternatives nowadays.  Modern process
supervisor should be used to ensure that a single named process is
running on a given configuration.

Alternatively, it's possible to wrap the named with flock(1).
2023-10-26 22:42:37 +02:00
Tom Krizek
4cb8b13987
Reformat shell scripts with shfmt
All changes in this commit were automated using the command:

  shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)
2023-10-26 10:23:50 +02:00
Michal Nowak
35792b1700
Report hung system tests
At times, a problem might occur where a test is not responding,
especially in the CI, determining the specific test responsible can be
difficult. Fortunately, when running tests with the pytest runner,
pytest sets the PYTEST_CURRENT_TEST environment variable to the current
test nodeid and stage. Afterward, the variable can be examined to
identify the test that has stopped responding.

The monitoring script needs to be started in the background. Still, the
shell executor used for BSD and FIPS testing can't handle the background
process cleanly, and the script step will wait for the background
process for the entire duration of the background process (currently
3000 seconds). Therefore, run the monitoring script only when the Docker
executor is used where this is not a problem.
2023-10-05 14:57:26 +02:00
Michal Nowak
93dc606fa8
Simplify Sphinx tools installation
Pointing pip3 to the "requirements file" eliminates the necessity for
removing comments.
2023-09-08 10:18:58 +02:00
Mark Andrews
936b73cb57 Free evp_md_ctx and pkey at exit 2023-09-01 12:01:20 +10:00
Mark Andrews
8529be30bb Clear OpenSSL errors on EVP_MD_CTX_create failures 2023-09-01 12:01:19 +10:00
Michal Nowak
520e97e2fc
Install Sphinx tools versions from BIND 9 repository
The doc/arm/requirements.txt file is the single source of truth when it
comes to Sphinx tools versions used to build documentation via
util/release-tarball-comparison.sh.
2023-08-31 14:31:57 +02:00
Tom Krizek
92143fa960
Update sphinx_rtd_theme
To resolve the version select and search issue on readthedocs.org,
sphinx_rtd_theme>=1.2.1 is required.

Related https://github.com/readthedocs/sphinx_rtd_theme/issues/1452
2023-08-29 10:07:05 +02:00
Ondřej Surý
784d055809
Add support for User Statically Defined Tracing (USDT) probes
This adds support for User Statically Defined Tracing (USDT).  On
Linux, this uses the header from SystemTap and dtrace utility, but the
support is universal as long as dtrace is available.

Also add the required infrastructure to add probes to libisc, libdns and
libns libraries, where most of the probes will be.
2023-08-21 18:39:53 +02:00
Michal Nowak
2d18c57c54
Make Debian 12 "bookworm" the base image
Just replace "bullseye" with "bookworm" and reintroduce Debian 11
"bullseye" later.
2023-08-21 16:35:52 +02:00
Michał Kępień
7f0790c82f Fix entity renumbering in util/parse_tsan.py
util/parse_tsan.py builds tables of mutexes, threads, and pointers it
finds in the TSAN report provided to it as a command-line argument and
then replaces all mentions of each of these entities so that they are
numbered sequentially in the processed report.  For example, this line:

    Cycle in lock order graph: M0 (...) => M5 (...) => M9 (...) => M0

is expected to become:

    Cycle in lock order graph: M1 (...) => M2 (...) => M3 (...) => M1

Problems arise when the gaps between mutex/thread identifiers present on
a single line are smaller than the total number of mutexes/threads found
by the script so far.  For example, the following line:

    Cycle in lock order graph: M0 (...) => M1 (...) => M2 (...) => M0

first gets turned into:

    Cycle in lock order graph: M1 (...) => M1 (...) => M2 (...) => M1

and then into:

    Cycle in lock order graph: M2 (...) => M2 (...) => M2 (...) => M2

In other words, lines like this become garbled due to information loss.

The problem stems from the fact that the numbering scheme the script
uses for identifying mutexes and threads is exactly the same as the one
used by TSAN itself.  Update util/parse_tsan.py so that it uses
zero-padded numbers instead, making the "overlapping" demonstrated above
impossible.
2023-06-15 16:17:14 +02:00
Tom Krizek
034a32a4f3
Add utility script to detect trailing whitespace
Run the script in CI as well to ensure we don't accidentally add
trailing whitespace again.
2023-06-13 15:06:38 +02:00
Tom Krizek
5893debf46
Remove trailing whitespace from all text files
I've used the following command to remove the trailing whitespace for
all tracked text files:

git grep -Il '' | xargs sed -i 's/[ \t]*$//'
2023-06-13 15:05:40 +02:00
Petr Špaček
751062da3b
Update release comparison scripts with liburcu and new Sphinx 2023-05-02 15:35:25 +02:00
Mark Andrews
c51a39e97a Probe if ED448 and ED25519 are supported
ED448 and ED25519 may or may not be supported in FIPS mode depending
upon the implementation.
2023-04-03 12:06:04 +10:00
Evan Hunt
6e9fce7a02 revise branch format
backport branches are now called "bind-9.x" instead of "v9_x".
2023-03-24 20:46:34 +00:00
Michal Nowak
0031af6035
Adapt release-tarball-comparison.sh to dotted tag notation
Recently, the tag notation format changed:

    v9_19_9     -> v9.19.9
    v9_18_13-S1 -> v9.18.13-S1

release-tarball-comparison.sh needs to adapt.
2023-03-22 15:58:15 +01:00
Michal Nowak
0bc4fad065
Adapt tarball comparison to dropped pregenerated man pages
Since pregenerated manual pages were removed from the BIND 9 repository,
Sphinx must be present in the build environment for manual pages to be
created and placed to release tarball. release-tarball-comparison.sh
script needs to be adapted to keep up with how to release tarballs are
prepared.
2023-03-09 16:55:46 +01:00