]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: fd: always remove late updates when freeing fd_updt[]
authorWilly Tarreau <w@1wt.eu>
Tue, 26 Jul 2022 17:06:17 +0000 (19:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 Jul 2022 17:06:17 +0000 (19:06 +0200)
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

index 634a6a33b5188dd2d67fb086b4dc7243151c5a58..ba864deed83f385c8c247017c773991d03fcca58 100644 (file)
--- 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);
 }