From b9831458374ba4bdba52aebe77a4005dcf59636d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 26 Jul 2022 19:06:17 +0200 Subject: [PATCH] BUG/MINOR: fd: always remove late updates when freeing fd_updt[] Christopher found that since commit 8e2c0fa8e ("MINOR: fd: delete unused updates on close()") we may crash in a late stop due to an fd_delete() in the main thread performed after all threads have deleted the fd_updt[] array. Prior to that commit that didn't happen because we didn't touch the updates on this path, but now it may happen. We don't care about these ones anyway since the poller is stopped, so let's just wipe them by resetting their counter before freeing the array. No backport is needed as this is only 2.7. --- src/fd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fd.c b/src/fd.c index 634a6a33b5..ba864deed8 100644 --- a/src/fd.c +++ b/src/fd.c @@ -984,6 +984,7 @@ static void deinit_pollers_per_thread() /* Release the pollers per thread, to be called late */ static void free_pollers_per_thread() { + fd_nbupdt = 0; ha_free(&fd_updt); } -- 2.47.3