From: Sam Gross Date: Wed, 31 Dec 2025 00:45:23 +0000 (-0500) Subject: gh-143121: Avoid thread leak in configure (gh-143122) X-Git-Tag: v3.15.0a5~11^2~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=469fe33edd92b8586d6995d07384b52170067c76;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/configure b/configure index b1faeaf806a9..411bc1a23226 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 043ec957f408..9e63c8f6144c 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],