From 469fe33edd92b8586d6995d07384b52170067c76 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 30 Dec 2025 19:45:23 -0500 Subject: [PATCH] gh-143121: Avoid thread leak in configure (gh-143122) If you are building with `--with-thread-sanitizer` and don't use the suppression file, then running configure will report a thread leak. Call `pthread_join()` to avoid the thread leak. --- configure | 1 + configure.ac | 1 + 2 files changed, 2 insertions(+) diff --git a/configure b/configure index b1faeaf806a..411bc1a2322 100755 --- a/configure +++ b/configure @@ -18190,6 +18190,7 @@ else case e in #( if (pthread_attr_init(&attr)) return (-1); if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1); if (pthread_create(&id, &attr, foo, NULL)) return (-1); + if (pthread_join(id, NULL)) return (-1); return (0); } _ACEOF diff --git a/configure.ac b/configure.ac index 043ec957f40..9e63c8f6144 100644 --- a/configure.ac +++ b/configure.ac @@ -4760,6 +4760,7 @@ if test "$posix_threads" = "yes"; then if (pthread_attr_init(&attr)) return (-1); if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1); if (pthread_create(&id, &attr, foo, NULL)) return (-1); + if (pthread_join(id, NULL)) return (-1); return (0); }]])], [ac_cv_pthread_system_supported=yes],