]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143121: Avoid thread leak in configure (gh-143122)
authorSam Gross <colesbury@gmail.com>
Wed, 31 Dec 2025 00:45:23 +0000 (19:45 -0500)
committerGitHub <noreply@github.com>
Wed, 31 Dec 2025 00:45:23 +0000 (19:45 -0500)
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
configure.ac

index b1faeaf806a9c66e74b81c1fbf00689aa51c4958..411bc1a23226e709ee61fee0037c279f21cd178e 100755 (executable)
--- 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
index 043ec957f408944100bbcd9ce6daebd37cef7e57..9e63c8f6144c3d06149d8695505e08a21c415478 100644 (file)
@@ -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],