Author: Miro Hrončok <[email protected]>
Branch: hroncok/fix-multiprocessing-regression-on-newer--1524656522151
Changeset: r94446:610fde79e505
Date: 2018-04-25 11:46 +0000
http://bitbucket.org/pypy/pypy/changeset/610fde79e505/
Log: 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 <[email protected]>
diff --git a/pypy/module/signal/interp_signal.py
b/pypy/module/signal/interp_signal.py
--- a/pypy/module/signal/interp_signal.py
+++ b/pypy/module/signal/interp_signal.py
@@ -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):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit