From 8a1bf46c9f8a83111d1d2ac5884af14c49b9d9c9 Mon Sep 17 00:00:00 2001
From: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Tue, 27 Sep 2016 11:41:05 +0200
Subject: Fix potentional build hanging due to zombie processes
---
...hild-threads-to-terminate-in-TestForkInThread.patch | 18 ++++++++++++++++++
python26.spec | 7 +++++++
2 files changed, 25 insertions(+)
create mode 100644 00230-force-all-child-threads-to-terminate-in-TestForkInThread.patch
diff --git a/00230-force-all-child-threads-to-terminate-in-TestForkInThread.patch
b/00230-force-all-child-threads-to-terminate-in-TestForkInThread.patch
new file mode 100644
index 0000000..b6b52b3
--- /dev/null
+++ b/00230-force-all-child-threads-to-terminate-in-TestForkInThread.patch
@@ -0,0 +1,18 @@
+diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py
+index 413889a..fb312aa 100644
+--- a/Lib/test/test_thread.py
++++ b/Lib/test/test_thread.py
+@@ -237,7 +237,12 @@ class TestForkInThread(unittest.TestCase):
+ if pid == 0: # child
+ os.close(self.read_fd)
+ os.write(self.write_fd, "OK")
+- sys.exit(0)
++ # Exiting the thread normally in the child process can leave
++ # any additional threads (such as the one started by
++ # importing _tkinter) still running, and this can prevent
++ # the half-zombie child process from being cleaned up. See
++ # Issue #26456.
++ os._exit(0)
+ else: # parent
+ os.close(self.write_fd)
+
diff --git a/python26.spec b/python26.spec
index d81d481..85d2276 100644
--- a/python26.spec
+++ b/python26.spec
@@ -503,6 +503,11 @@ Patch212: 00212-fix-test-pyexpat-failure.patch
# Skip db related tests
Patch186: python26-skip-db-tests.patch
+# Force all child threads to terminate in TestForkInThread, so no zombie
+# processes get left behind with stalled threads which hang Python builds
+#
https://bugs.python.org/issue26456
+Patch230: 00230-force-all-child-threads-to-terminate-in-TestForkInThread.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: readline-devel, openssl-devel, gmp-devel
BuildRequires: ncurses-devel, gdbm-devel, zlib-devel
@@ -731,6 +736,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch212 -p1
+%patch230 -p1
+
# Don't build these crypto algorithms; instead rely on _hashlib and OpenSSL:
for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
rm Modules/$f
--
cgit v0.12
http://pkgs.fedoraproject.org/cgit/python26.git/commit/?h=f23&id=8a1b...