bind9/fuzz
Tony Finch 4b5ec07bb7 Refactor qp-trie to use QSBR
The first working multi-threaded qp-trie was stuck with an unpleasant
trade-off:

  * Use `isc_rwlock`, which has acceptable write performance, but
    terrible read scalability because the qp-trie made all accesses
    through a single lock.

  * Use `liburcu`, which has great read scalability, but terrible
    write performance, because I was relying on `rcu_synchronize()`
    which is rather slow. And `liburcu` is LGPL.

To get the best of both worlds, we need our own scalable read side,
which we now have with `isc_qsbr`. And we need to modify the write
side so that it is not blocked by readers.

Better write performance requires an async cleanup function like
`call_rcu()`, instead of the blocking `rcu_synchronize()`. (There
is no blocking cleanup in `isc_qsbr`, because I have concluded
that it would be an attractive nuisance.)

Until now, all my multithreading qp-trie designs have been based
around two versions, read-only and mutable. This is too few to
work with asynchronous cleanup. The bare minimum (as in epoch
based reclamation) is three, but it makes more sense to support an
arbitrary number. Doing multi-version support "properly" makes
fewer assumptions about how safe memory reclamation works, and it
makes snapshots and rollbacks simpler.

To avoid making the memory management even more complicated, I
have introduced a new kind of "packed reader node" to anchor the
root of a version of the trie. This is simpler because it re-uses
the existing chunk lifetime logic - see the discussion under
"packed reader nodes" in `qp_p.h`.

I have also made the chunk lifetime logic simpler. The idea of a
"generation" is gone; instead, chunks are either mutable or
immutable. And the QSBR phase number is used to indicate when a
chunk can be reclaimed.

Instead of the `shared_base` flag (which was basically a one-bit
reference count, with a two version limit) the base array now has a
refcount, which replaces the confusing ad-hoc lifetime logic with
something more familiar and systematic.
2023-02-27 13:47:55 +00:00
..
dns_master_load.in Add test case for issue-45178 2022-04-01 07:56:52 +00:00
dns_message_checksig.in Add seed to reproduce issue memory leak in dns_message_checktsig 2022-09-26 16:29:36 +02:00
dns_message_parse.in Add packet from issue #4189 2020-09-30 13:24:29 +00:00
dns_name_fromtext_target.in oss-fuzz: Improve interaction with fuzzing tools and add new tests in fuzz/ directory 2018-08-23 10:07:28 +02:00
dns_name_fromwire.in Fuzzing and benchmarking for dns_name_fromwire() 2022-11-17 08:45:17 +00:00
dns_qp.in Fuzz testing the qp-trie 2023-02-27 13:47:25 +00:00
dns_qpkey_name.in Fuzz testing the qp-trie 2023-02-27 13:47:25 +00:00
dns_rdata_fromtext.in Add seed that demonstrated INSIST triggered in isc_lex_gettoken 2022-03-01 16:05:39 -08:00
dns_rdata_fromwire_text.in add svcb fuzzing seed 2021-08-18 13:49:48 +10:00
isc_lex_getmastertoken.in Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
isc_lex_gettoken.in Mark setting operating system limits from named.conf as ancient 2022-12-07 19:40:00 +01:00
.gitignore Fuzz testing the qp-trie 2023-02-27 13:47:25 +00:00
afl.sh Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
dns_master_load.c Add dns_master_loadbuffer() fuzzer 2022-02-24 10:02:56 +01:00
dns_message_checksig.c Remove do-nothing header <isc/print.h> 2023-02-15 16:44:47 +00:00
dns_message_parse.c Remove do-nothing header <isc/print.h> 2023-02-15 16:44:47 +00:00
dns_name_fromtext_target.c Add dns_rdata_fromtext() fuzzer 2022-02-24 11:12:06 +01:00
dns_name_fromwire.c Remove unused support for fromwire(DNS_NAME_DOWNCASE) 2023-02-06 13:26:36 +00:00
dns_qp.c Refactor qp-trie to use QSBR 2023-02-27 13:47:55 +00:00
dns_qpkey_name.c Fuzz testing the qp-trie 2023-02-27 13:47:25 +00:00
dns_rdata_fromtext.c Remove do-nothing header <isc/print.h> 2023-02-15 16:44:47 +00:00
dns_rdata_fromwire_text.c Remove unused support for fromwire(DNS_NAME_DOWNCASE) 2023-02-06 13:26:36 +00:00
fuzz.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
FUZZING.md Fix configure options in FUZZING.md 2022-02-24 11:12:02 +01:00
isc_lex_getmastertoken.c Change the return type of isc_lex_create() to void 2022-10-26 12:55:06 +02:00
isc_lex_gettoken.c Change the return type of isc_lex_create() to void 2022-10-26 12:55:06 +02:00
libfuzzer.sh Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
main.c Detect errors in fuzzer initialization 2022-09-27 11:21:38 +02:00
Makefile.am Refactor qp-trie to use QSBR 2023-02-27 13:47:55 +00:00
old.c Fuzzing and benchmarking for dns_name_fromwire() 2022-11-17 08:45:17 +00:00
old.h Fuzzing and benchmarking for dns_name_fromwire() 2022-11-17 08:45:17 +00:00