From 88f5b5ec1c125d8e47aa17a9cd550abddb46de99 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 23 Dec 2025 15:48:50 -0500 Subject: [PATCH] gh-143121: Avoid thread leak in configure 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 b1faeaf806a9c6..411bc1a23226e7 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 043ec957f40894..9e63c8f6144c3d 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],