Assertion failure in the "shutdown" system test (dns_resolver_attach() error)
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2221481
10330 void
10331 dns_resolver_attach(dns_resolver_t *source, dns_resolver_t **targetp) {
10332 REQUIRE(VALID_RESOLVER(source));
10333 REQUIRE(targetp != NULL && *targetp == NULL);
10334
10335 RRTRACE(source, "attach");
10336
10337 >>>> REQUIRE(!atomic_load_acquire(&source->exiting));
10338 isc_refcount_increment(&source->references);
10339
10340 *targetp = source;
10341 }
Click to expand
D:shutdown:tests-shutdown.py::test_named_shutdown FAILED [100%] D:shutdown: D:shutdown:=================================== FAILURES =================================== D:shutdown:_____________________________ test_named_shutdown ______________________________ D:shutdown: D:shutdown:named_port = 29944, control_port = 29956 D:shutdown: D:shutdown:@pytest.mark.dnspython D:shutdown:def test_named_shutdown(named_port, control_port): D:shutdown:# pylint: disable-msg=too-many-locals D:shutdown:cfg_dir = os.path.join(os.getcwd(), "resolver") D:shutdown:assert os.path.isdir(cfg_dir) D:shutdown: D:shutdown:cfg_file = os.path.join(cfg_dir, "named.conf") D:shutdown:assert os.path.isfile(cfg_file) D:shutdown: D:shutdown:named = os.getenv("NAMED") D:shutdown:assert named is not None D:shutdown: D:shutdown:rndc = os.getenv("RNDC") D:shutdown:assert rndc is not None D:shutdown: D:shutdown:# rndc configuration resides in ../common/rndc.conf D:shutdown:rndc_cfg = os.path.join("..", "common", "rndc.conf") D:shutdown:assert os.path.isfile(rndc_cfg) D:shutdown: D:shutdown:# rndc command with default arguments. D:shutdown:rndc_cmd = [rndc, "-c", rndc_cfg, "-p", str(control_port), D:shutdown:"-s", "10.53.0.3"] D:shutdown: D:shutdown:# We create a resolver instance that will be used to send queries. D:shutdown:resolver = dns.resolver.Resolver() D:shutdown:resolver.nameservers = ['10.53.0.3'] D:shutdown:resolver.port = named_port D:shutdown: D:shutdown:# We test named shutting down using two methods: D:shutdown:# Method 1: using rndc ctop D:shutdown:# Method 2: killing with SIGTERM D:shutdown:# In both methods named should exit gracefully. D:shutdown:for kill_method in ("rndc", "sigterm"): D:shutdown:named_cmdline = [named, "-c", cfg_file, "-f"] D:shutdown:with subprocess.Popen(named_cmdline, cwd=cfg_dir) as named_proc: D:shutdown:# Ensure named is running D:shutdown:assert named_proc.poll() is None D:shutdown:# wait for named to finish loading D:shutdown:for _ in range(10): D:shutdown:try: D:shutdown:resolver.query('version.bind', 'TXT', 'CH') D:shutdown:break D:shutdown:except (dns.resolver.NoNameservers, dns.exception.Timeout): D:shutdown:time.sleep(1) D:shutdown: D:shutdown:do_work(named_proc, resolver, rndc_cmd, D:shutdown:kill_method, n_workers=12, n_queries=16) D:shutdown: D:shutdown:# Wait named to exit for a maximum of MAX_TIMEOUT seconds. D:shutdown:MAX_TIMEOUT = 10 D:shutdown:is_dead = False D:shutdown:for _ in range(MAX_TIMEOUT): D:shutdown:if named_proc.poll() is not None: D:shutdown:is_dead = True D:shutdown:break D:shutdown:time.sleep(1) D:shutdown: D:shutdown:if not is_dead: D:shutdown:named_proc.send_signal(signal.SIGABRT) D:shutdown:for _ in range(MAX_TIMEOUT): D:shutdown:if named_proc.poll() is not None: D:shutdown:is_dead = True D:shutdown:break D:shutdown:time.sleep(1) D:shutdown:if not is_dead: D:shutdown:named_proc.kill() D:shutdown: D:shutdown:assert is_dead D:shutdown:# Ensures that named exited gracefully. D:shutdown:# If it crashed (abort()) exitcode will be non zero. D:shutdown:> assert named_proc.returncode == 0 D:shutdown:E assert -6 == 0 D:shutdown:E + where -6 = .returncode D:shutdown: D:shutdown:tests-shutdown.py:199: AssertionError D:shutdown:----------------------------- Captured stderr call ----------------------------- D:shutdown:rndc: rndc: recv failed: connection resetrecv failed: connection reset D:shutdown: D:shutdown:rndc: connect failed: 10.53.0.3#29956: connection refused D:shutdown:rndc: connect failed: 10.53.0.3#29956: connection refused D:shutdown:rndc: connect failed: 10.53.0.3#29956: connection refused D:shutdown:rndc: connect failed: 10.53.0.3#29956: connection refused D:shutdown:rndc: connect failed: 10.53.0.3#29956: connection refused D:shutdown:rndc: rndc: rndc: rndc: rndc: rndc: recv failed: connection resetrecv failed: connection resetrecv failed: connection resetrecv failed: connection resetrecv failed: connection resetrecv failed: connection reset D:shutdown: D:shutdown: D:shutdown: D:shutdown: D:shutdown: D:shutdown:rndc: connect failed: 10.53.0.3#29956: connection refused D:shutdown:========================== 1 failed in 64.25 seconds =========================== I:system:FAILED I:shutdown:stopping servers I:shutdown:Core dump(s) found: shutdown/resolver/core.30561 D:shutdown:backtrace from shutdown/resolver/core.30561: D:shutdown:-------------------------------------------------------------------------------- D:shutdown:Core was generated by `/builds/isc-projects/bind9/bin/named/.libs/named -c /builds/isc-projects/bind9/'. D:shutdown:Program terminated with signal SIGABRT, Aborted. D:shutdown:#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 D:shutdown:[Current thread is 1 (Thread 0x7f2077bff700 (LWP 30575))] D:shutdown:#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 D:shutdown:#1 0x00007f207cac9921 in __GI_abort () at abort.c:79 D:shutdown:#2 0x0000561eb31883a2 in assertion_failed (file=, line=, type=, cond=0x7f207f028778 "!__extension__ ({ __auto_type __atomic_load_ptr = ((&source->exiting)); __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (memory_order_acquire))"...) at main.c:238 D:shutdown:#3 0x00007f207f29ed3a in isc_assertion_failed (file=file@entry=0x7f207f029159 "resolver.c", line=line@entry=10337, type=type@entry=isc_assertiontype_require, cond=cond@entry=0x7f207f028778 "!__extension__ ({ __auto_type __atomic_load_ptr = ((&source->exiting)); __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (memory_order_acquire))"...) at assertions.c:49 D:shutdown:#4 0x00007f207ef778eb in dns_resolver_attach (source=source@entry=0x7f206ecc7200, targetp=targetp@entry=0x7f206e7498d0) at resolver.c:10337 D:shutdown:#5 0x00007f207ef7d82d in dns_resolver_createfetch (res=0x7f206ecc7200, name=name@entry=0x7f206cc2f148, type=type@entry=28, domain=domain@entry=0x7f2077bf9020, nameservers=nameservers@entry=0x7f2077bf8fb0, forwarders=forwarders@entry=0x0, client=0x0, id=0, options=34, depth=2, qc=0x7f206d02a0d0, task=0x7f206e65dc80, action=0x7f207ee8cf30 , arg=0x7f206cc2f140, rdataset=0x7f2077ff82b0, sigrdataset=0x0, fetchp=0x7f2077ff82a8) at resolver.c:10610 D:shutdown:#6 0x00007f207ee8a4b1 in fetch_name (adbname=adbname@entry=0x7f206cc2f140, start_at_zone=start_at_zone@entry=true, depth=depth@entry=2, qc=qc@entry=0x7f206d02a0d0, type=type@entry=28) at adb.c:4041 D:shutdown:#7 0x00007f207ee96d71 in dns_adb_createfind (adb=0x7f206e61c980, task=0x7f206e65b700, action=action@entry=0x7f207ef840f0 , arg=0x7f206cc5c000, name=name@entry=0x7f2077bf9d50, qname=0x7f206cc5c010, qtype=28, options=239, now=, target=0x0, port=29944, depth=2, qc=0x7f206d02a0d0, findp=0x7f2077bf9800) at adb.c:3123 D:shutdown:#8 0x00007f207ef7d159 in findname (fctx=, fctx@entry=0x7f206cc5c000, name=name@entry=0x7f2077bf9d50, port=port@entry=0, options=, options@entry=15, flags=flags@entry=0, now=1641906898, overquota=0x7f2077bf9cf8, need_alternate=0x7f2077bf9cd7, no_addresses=0x7f2077bf9cdc) at resolver.c:3308 D:shutdown:#9 0x00007f207ef813e9 in fctx_getaddresses (badcache=false, fctx=0x7f206cc5c000) at resolver.c:3643 D:shutdown:#10 fctx_try (fctx=fctx@entry=0x7f206cc5c000, retrying=, badcache=badcache@entry=false) at resolver.c:4033 D:shutdown:#11 0x00007f207ef85c37 in rctx_nextserver (rctx=rctx@entry=0x7f2077bfaa50, message=, addrinfo=addrinfo@entry=0x7f206ed3bb00, result=, result@entry=ISC_R_SUCCESS) at resolver.c:9528 D:shutdown:#12 0x00007f207ef86d63 in rctx_done (rctx=rctx@entry=0x7f2077bfaa50, result=result@entry=ISC_R_SUCCESS) at resolver.c:9670 D:shutdown:#13 0x00007f207ef879b7 in resquery_response (eresult=eresult@entry=ISC_R_SHUTTINGDOWN, region=region@entry=0x7f2077bfb730, arg=) at resolver.c:7644 D:shutdown:#14 0x00007f207eeacaf7 in udp_recv (handle=, eresult=, region=0x7f2077bfb730, arg=) at dispatch.c:593 D:shutdown:#15 0x00007f207f28d1ed in isc__nm_async_readcb (worker=worker@entry=0x7f2077c27000, ev0=ev0@entry=0x7f203fc10c00) at netmgr/netmgr.c:2809 D:shutdown:#16 0x00007f207f28d933 in process_netievent (worker=worker@entry=0x7f2077c27000, ievent=0x7f203fc10c00) at netmgr/netmgr.c:971 D:shutdown:#17 0x00007f207f28e095 in process_queue (worker=worker@entry=0x7f2077c27000, type=type@entry=NETIEVENT_NORMAL) at netmgr/netmgr.c:1010 D:shutdown:#18 0x00007f207f28e844 in process_all_queues (worker=0x7f2077c27000) at netmgr/netmgr.c:756 D:shutdown:#19 async_cb (handle=0x7f2077c27360) at netmgr/netmgr.c:785 D:shutdown:#20 0x00007f207dab23b4 in ?? () from /usr/lib/x86_64-linux-gnu/libuv.so.1 D:shutdown:#21 0x00007f207dac2340 in uv.io_poll () from /usr/lib/x86_6 4-linux-gnu/libuv.so.1 nux-gnu/libuv.so.1 D:shutdown:#23 0x00007f207f28e12e in nm_thread (worker0=0x7f2077c27000) at netmgr/netmgr.c:691 D:shutdown:#24 0x00007f207f2ca166 in isc__trampoline_run (arg=0x561eb3f00710) at trampoline.c:187 D:shutdown:#25 0x00007f207ce816db in start_thread (arg=0x7f2077bff700) at pthread_create.c:463 D:shutdown:#26 0x00007f207cbaa71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 D:shutdown:-------------------------------------------------------------------------------- D:shutdown:full backtrace from shutdown/resolver/core.30561 saved in shutdown/resolver/core.30561-backtrace.txt D:shutdown:core dump shutdown/resolver/core.30561 archived as shutdown/resolver/core.30561.gz R:shutdown:FAIL E:shutdown:2022-01-11T13:15:31+0000 FAIL: shutdown