INSIST failure processing DNAME in query_dname
Support has reports of assertion failures on lookups involving DNAME. https://support.isc.org/Ticket/Display.html?id=20155
Queries for www.voyage-ile-de-france.fr can cause a RUNTIME_CHECK failure in query.c:query_dname.
; <<>> DiG 9.16.22 <<>> @nscache02.mrs.prive.nic.fr www.voyage-ile-de-france.fr
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47904
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: e4810fabca4bf153010000006207e34d4f199e76a4d6fca8 (good)
;; QUESTION SECTION:
;www.voyage-ile-de-france.fr. IN A
;; ANSWER SECTION:
voyage-ile-de-france.fr. 3595 IN DNAME pagesjaunes.fr.
www.voyage-ile-de-france.fr. 3595 IN CNAME www.pagesjaunes.fr.
www.pagesjaunes.fr. 295 IN CNAME www.pagesjaunes.fr.cdn.cloudflare.net.
www.pagesjaunes.fr.cdn.cloudflare.net. 295 IN A 104.19.237.56
www.pagesjaunes.fr.cdn.cloudflare.net. 295 IN A 104.19.236.56
;; Query time: 24 msec
;; SERVER: 2001:67c:2219:15::163#53(2001:67c:2219:15::163)
;; WHEN: Sat Feb 12 16:41:49 UTC 2022
;; MSG SIZE rcvd: 213
One example stack trace (late 9.17) below.
Thread 1 Crashed:
0 libsystem_kernel.dylib 0x0000000192a80e68 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000192ab343c pthread_kill + 292
2 libsystem_c.dylib 0x00000001929fb454 abort + 124
3 named 0x0000000102e6a9d0 assertion_failed + 552 (main.c:238)
4 libisc-9.17.22.dylib 0x0000000103282258 isc_assertion_failed + 56 (assertions.c:49)
5 libns-9.17.22.dylib 0x0000000102f29a6c query_dname + 380 (query.c:10520)
6 libns-9.17.22.dylib 0x0000000102f25d28 query_gotanswer + 1076 (query.c:7648)
7 libns-9.17.22.dylib 0x0000000102f210c0 query_lookup + 1996 (query.c:6003)
8 libns-9.17.22.dylib 0x0000000102f35e00 query_zone_delegation + 1280 (query.c:8808)
9 libns-9.17.22.dylib 0x0000000102f279cc query_delegation + 280 (query.c:8836)
10 libns-9.17.22.dylib 0x0000000102f25c7c query_gotanswer + 904 (query.c:7621)
11 libns-9.17.22.dylib 0x0000000102f210c0 query_lookup + 1996 (query.c:6003)
12 libns-9.17.22.dylib 0x0000000102f1fb6c ns__query_start + 2012 (query.c:5643)
13 libns-9.17.22.dylib 0x0000000102f24a04 query_setup + 368 (query.c:5357)
14 libns-9.17.22.dylib 0x0000000102f241c4 ns_query_start + 1684 (query.c:12222)
15 libns-9.17.22.dylib 0x0000000102f15c44 ns__client_request + 5152 (client.c:2225)
16 libisc-9.17.22.dylib 0x000000010326b31c isc__nm_async_readcb + 408 (netmgr.c:2798)
17 libisc-9.17.22.dylib 0x000000010326b130 isc__nm_readcb + 304 (netmgr.c:2771)
18 libisc-9.17.22.dylib 0x000000010327d880 udp_recv_cb + 676 (udp.c:642)
19 libuv.1.dylib 0x0000000103eee99c uv__udp_io + 288
20 libuv.1.dylib 0x0000000103ef1aac uv__io_poll + 1592
21 libuv.1.dylib 0x0000000103ee25f0 uv_run + 320
22 libisc-9.17.22.dylib 0x00000001032616b0 nm_thread + 84 (netmgr.c:691)
23 libisc-9.17.22.dylib 0x00000001032bae28 isc__trampoline_run + 52 (trampoline.c:187)
24 libsystem_pthread.dylib 0x0000000192ab3878 _pthread_start + 320
25 libsystem_pthread.dylib 0x0000000192aae5e0 thread_start + 8
The INSIST in question:
/*
* Compare the current qname to the found name. We need
* to know how many labels and bits are in common because
* we're going to have to split qname later on.
*/
namereln = dns_name_fullcompare(qctx->client->query.qname, qctx->fname,
&order, &nlabels);
INSIST(namereln == dns_namereln_subdomain);
when I added code to log the two names when namereln != dns_namereln_subdomain
I got:
15-Feb-2022 21:03:19.019 client @0x130081368 ::1#49227 (www.voyage-ile-de-france.fr): view secure: namereln=dns_namereln_commonancestor, qctx->client->query.qname=www.voyage-ile-de-france.fr, qctx->fname=proxy.mythic-beasts.com
15-Feb-2022 21:03:19.021 query.c:10539: INSIST(namereln == dns_namereln_subdomain) failed, back trace
Edited by Mark Andrews