From: Michał Kępień Date: Wed, 19 Jan 2022 13:30:17 +0000 (+0100) Subject: rndc: prevent crashing after receiving a signal X-Git-Tag: v9.18.0~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1d721aae1ba9bef8752b2d55bdc95b603096447;p=thirdparty%2Fbind9.git rndc: prevent crashing after receiving a signal If isc_app_run() gets interrupted by a signal, the global 'rndc_task' variable may already be detached from (set to NULL) by the time the outstanding netmgr callbacks are run. This triggers an assertion failure in isc_task_shutdown(). However, explicitly calling isc_task_shutdown() from rndc code is redundant because it does not use isc_task_onshutdown() and the task_shutdown() function gets automatically called anyway when the task manager gets destroyed (after isc_app_run() returns). Remove the redundant isc_task_shutdown() calls to prevent crashes after receiving a signal. --- diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c index c6e3212f685..f25db5a80ad 100644 --- a/bin/rndc/rndc.c +++ b/bin/rndc/rndc.c @@ -307,7 +307,6 @@ rndc_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) { atomic_load_acquire(&recvs) == 0) { shuttingdown = true; - isc_task_shutdown(rndc_task); isc_app_shutdown(); } } @@ -393,7 +392,6 @@ rndc_recvdone(isc_nmhandle_t *handle, isc_result_t result, void *arg) { atomic_fetch_sub_release(&recvs, 1) == 1) { shuttingdown = true; - isc_task_shutdown(rndc_task); isc_app_shutdown(); } }