]> git.ipfire.org Git - thirdparty/bind9.git/commit
fix: dev: Call rcu_barrier earlier in the destructor
authorAlessio Podda <alessio@isc.org>
Fri, 25 Apr 2025 12:30:49 +0000 (12:30 +0000)
committerAlessio Podda <alessio@isc.org>
Fri, 25 Apr 2025 12:30:49 +0000 (12:30 +0000)
commit962b75dca46d40e91a50f450b29dea36650764db
treecc21dbb904cb0a1f42470091769cabf581a7e5ba
parent336c9d51147833415d76cc688781200c04f04cad
parent59086c33e2edb9ebc4f5b5bc6cde35f851a6f45b
fix: dev: Call rcu_barrier earlier in the destructor

If a call_rcu thread is running, there is a possible race condition
where the destructors run before all call_rcu callbacks have finished
running. This can happen, for example, if the call_rcu callback tries to
log something after the logging context has been torn down.

In !10394, we tried to counter this by explicitely creating a call_rcu
thread an shutting it down before running the destructors, but it is
possible for things to "slip" and end up on the default call_rcu thread.

As a quickfix, this commit moves an rcu_barrier() that was in the mem
context destructor earlier, so that it "protects" all libisc
destructors.

Closes #5296

Merge branch '5296-join-rcu-thread-on-shutdown' into 'main'

See merge request isc-projects/bind9!10423