Skip to content

[3.6] bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) #6582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix multiprocessing regression on newer glibcs
14 changes: 8 additions & 6 deletions Modules/signalmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,6 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask)
int result = -1;
PyObject *iterator, *item;
long signum;
int err;

sigemptyset(mask);

Expand All @@ -781,11 +780,14 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask)
Py_DECREF(item);
if (signum == -1 && PyErr_Occurred())
goto error;
if (0 < signum && signum < NSIG)
err = sigaddset(mask, (int)signum);
else
err = 1;
if (err) {
if (0 < signum && signum < NSIG) {
/* bpo-33329: ignore 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.
*/
(void) sigaddset(mask, (int)signum);
}
else {
PyErr_Format(PyExc_ValueError,
"signal number %ld out of range", signum);
goto error;
Expand Down