pypy3.9/302-fix-multiprocessing-regression-on-newer-glibcs.patch

36 lines
1.5 KiB
Diff
Raw Normal View History

# HG changeset patch
# User Miro Hrončok <miro@hroncok.cz>
# Date 1524655710 -7200
# Wed Apr 25 13:28:30 2018 +0200
# Branch issue33329
# Node ID 6501fdc3a80fa2bc3b8c70bfaf94a31c3b3432c0
# Parent a07f07034d281bec8c776f9e1ee7c5b9aea74007
Fix multiprocessing regression on newer glibcs
Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some
reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom
is commonly used to select all signals for blocking with `pthread_sigmask`.
So we ignore the sigaddset() return value until we expose sigfillset()
to provide a better idiom.
Co-authored-by: Antoine Pitrou <antoine@python.org>
diff -r a07f07034d28 -r 6501fdc3a80f pypy/module/signal/interp_signal.py
--- a/pypy/module/signal/interp_signal.py Tue Apr 24 10:00:00 2018 +0200
+++ b/pypy/module/signal/interp_signal.py Wed Apr 25 13:28:30 2018 +0200
@@ -379,10 +379,10 @@
for w_signum in space.unpackiterable(self.w_signals):
signum = space.int_w(w_signum)
check_signum_in_range(space, signum)
- err = c_sigaddset(self.mask, signum)
- if err:
- raise oefmt(space.w_ValueError,
- "signal number %d out of range", signum)
+ # bpo-33329: ignore c_sigaddset() return value as it can fail
+ # for some reserved signals, but we want the `range(1, NSIG)`
+ # idiom to allow selecting all valid signals.
+ c_sigaddset(self.mask, signum)
return self.mask
def __exit__(self, *args):