Inconsistent view state after some cases of failed reconfiguration attempts
Relating to Support Ticket RT #19959
After some types of reconfiguration failures the default view ends up in an inconsistent state, namely with a zonetable
set to NULL. If this happens during a catalog zone update process, named
crashes with:
19:16:46.485 general: error: ./server.c:4648: unexpected error:
19:16:46.485 general: error: unable to obtain neither an IPv4 nor an IPv6 dispatch
19:16:46.496 general: info: catz: updating catalog zone 'redacted.catalogs.redacted' with serial 6
19:16:46.496 general: error: reloading configuration failed: unexpected error
19:16:46.498 general: critical: zt.c:164: REQUIRE((__builtin_expect(!!((zt) != ((void *)0)), 1) && __builtin_expect(!!(((const isc__magic_t *)(zt))->magic == ((('Z') << 24 | ('T') << 16 | ('b') << 8 | ('l')))), 1))) failed, back trace
That was an excerpt from a customer reported log file, running BIND v9.16.23. A similar crash can be reproduced on main
by starting the catz system test, and bombarding its ns2 with rndc reconfig
using this command in bin/rndc directory: watch -n 1 ./rndc ../tests/system/common/rndc.conf -p 5312 -s 10.53.0.2 reconfig
.
At some point in the end of the test reconfiguration fails with "load_configuration: already exists" error (that might be another issue), and ns2 crashes similarly short after that:
16-Dec-2021 17:38:33.463 none:1: zone 'dom14.example' already exists
16-Dec-2021 17:38:33.463 load_configuration: already exists
16-Dec-2021 17:38:33.463 reloading configuration failed: already exists
16-Dec-2021 17:38:33.463 freeing control connection
16-Dec-2021 17:38:34.243 catz: updating catalog zone 'catalog1.example' with serial 50
16-Dec-2021 17:38:34.243 catz: update_from_db: iteration finished
16-Dec-2021 17:38:34.243 catz: iterating over 'dom7.example' from catalog 'catalog1.example'
16-Dec-2021 17:38:34.243 zt.c:164: REQUIRE(((zt) != ((void *)0) && ((const isc__magic_t *)(zt))->magic == ((('Z') << 24 | ('T') << 16 | ('b') << 8 | ('l'))))) failed, back trace
Back trace is isc_task_run() -> dns_catz_update_taskaction() -> dns_catz_update_from_db() -> dns_catz_zones_merge() -> dns_zt_find().