From: Willy Tarreau Date: Mon, 30 Jul 2018 08:44:51 +0000 (+0200) Subject: BUG/MEDIUM: threads: properly fix nbthreads == MAX_THREADS X-Git-Tag: v1.9-dev1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e954e1f27729f85eabc4fe4159a3460774f3abc;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: threads: properly fix nbthreads == MAX_THREADS While moving Olivier's patch for nbthread==MAX_THREADS in commit 3e12304 ("BUG/MINOR: threads: Handle nbthread == MAX_THREADS.") to hathreads.c, I missed one place resulting in the computed thread mask being used as the thread count, which is worse than the initial bug. Let's fix it properly this time. This fix must be backported to 1.8 just like the other one. --- diff --git a/src/haproxy.c b/src/haproxy.c index a174391631..8525593e2e 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3030,7 +3030,7 @@ int main(int argc, char **argv) int i; sigset_t blocked_sig, old_sig; - THREAD_SYNC_INIT((1UL << global.nbthread) - 1); + THREAD_SYNC_INIT(global.nbthread); /* Init tids array */ for (i = 0; i < global.nbthread; i++)