59 lines
2.3 KiB
Diff
59 lines
2.3 KiB
Diff
From cfec5c81d6513791a170d101cf2f27773f3052f1 Mon Sep 17 00:00:00 2001
|
|
From: Petr Lautrbach <lautrbach@redhat.com>
|
|
Date: Mon, 30 Jun 2025 11:20:56 +0200
|
|
Subject: [PATCH] sepolicy: use multiprocessing 'fork' method
|
|
|
|
'fork' was the default starting method in Python before 3.14 and it's
|
|
necessary for this code to work correctly
|
|
|
|
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2374569
|
|
|
|
sh-5.2# sepolicy manpage -a -p /builddir/build/BUILD/selinux-policy-41.43-build/BUILDROOT/usr/share/man/man8/ -w -r /builddir/build/BUILD/selinux-policy-41.43-build/BUILDROOT
|
|
ValueError: No SELinux Policy installed
|
|
Exception ignored while calling deallocator <function Pool.__del__ at 0x7f36f9d333d0>:
|
|
Traceback (most recent call last):
|
|
File "/usr/lib64/python3.14/multiprocessing/pool.py", line 271, in __del__
|
|
self._change_notifier.put(None)
|
|
File "/usr/lib64/python3.14/multiprocessing/queues.py", line 397, in put
|
|
self._writer.send_bytes(obj)
|
|
File "/usr/lib64/python3.14/multiprocessing/connection.py", line 206, in send_bytes
|
|
self._send_bytes(m[offset:offset + size])
|
|
File "/usr/lib64/python3.14/multiprocessing/connection.py", line 444, in _send_bytes
|
|
self._send(header + buf)
|
|
File "/usr/lib64/python3.14/multiprocessing/connection.py", line 400, in _send
|
|
n = write(self._handle, buf)
|
|
BrokenPipeError: [Errno 32] Broken pipe
|
|
|
|
Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
|
|
Acked-by: James Carter <jwcart2@gmail.com>
|
|
---
|
|
python/sepolicy/sepolicy.py | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/python/sepolicy/sepolicy.py b/python/sepolicy/sepolicy.py
|
|
index 82ff6af2..febb2fc1 100755
|
|
--- a/python/sepolicy/sepolicy.py
|
|
+++ b/python/sepolicy/sepolicy.py
|
|
@@ -25,7 +25,7 @@ import os
|
|
import sys
|
|
import selinux
|
|
import sepolicy
|
|
-from multiprocessing import Pool
|
|
+import multiprocessing
|
|
from sepolicy import get_os_version, get_conditionals, get_conditionals_format_text
|
|
import argparse
|
|
PROGNAME = "selinux-python"
|
|
@@ -350,7 +350,8 @@ def manpage(args):
|
|
|
|
manpage_domains = set()
|
|
manpage_roles = set()
|
|
- p = Pool()
|
|
+ multiprocessing.set_start_method('fork')
|
|
+ p = multiprocessing.Pool()
|
|
async_results = []
|
|
for domain in test_domains:
|
|
async_results.append(p.apply_async(manpage_work, [domain, path, args.root, args.source_files, args.web]))
|
|
--
|
|
2.49.0
|
|
|