diff options
author | Ross Burton <ross.burton@intel.com> | 2018-09-10 14:31:23 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-13 07:42:28 +0100 |
commit | cb4134f7982b339c85460efb40fa640db963988a (patch) | |
tree | 86a93716efb9d182d79164e0b86c9a2bfab45f7f /meta/recipes-devtools/python | |
parent | 27849379a71ba200b461d045a4946eacba8cd62f (diff) | |
download | poky-cb4134f7982b339c85460efb40fa640db963988a.tar.gz |
python3: fix multiprocessing
glibc 2.28 slightly changed the behaviour of sigaddset() which broke
multiprocessing. Backport a patch from Python 3.6 to solve this.
(From OE-Core rev: df1874eda517070dab86270ffafd5fe9a307e76b)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r-- | meta/recipes-devtools/python/python3/signal.patch | 56 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.5.5.bb | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/signal.patch b/meta/recipes-devtools/python/python3/signal.patch new file mode 100644 index 0000000000..534a097771 --- /dev/null +++ b/meta/recipes-devtools/python/python3/signal.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
3 | |||
4 | From 4315389df3c4e8c1f94a18ab11a4b234762132b1 Mon Sep 17 00:00:00 2001 | ||
5 | From: Antoine Pitrou <pitrou@free.fr> | ||
6 | Date: Mon, 23 Apr 2018 22:22:49 +0200 | ||
7 | Subject: [PATCH] [3.6] bpo-33329: Fix multiprocessing regression on newer | ||
8 | glibcs (GH-6575) (GH-6582) | ||
9 | |||
10 | Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some | ||
11 | reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom | ||
12 | is commonly used to select all signals for blocking with `pthread_sigmask`. | ||
13 | So we ignore the sigaddset() return value until we expose sigfillset() | ||
14 | to provide a better idiom. | ||
15 | (cherry picked from commit 25038ecfb665bef641abf8cb61afff7505b0e008) | ||
16 | --- | ||
17 | .../next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst | 1 + | ||
18 | Modules/signalmodule.c | 14 ++++++++------ | ||
19 | 2 files changed, 9 insertions(+), 6 deletions(-) | ||
20 | create mode 100644 Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst | ||
21 | |||
22 | diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c | ||
23 | index e0d06b434d..138e74e8a9 100644 | ||
24 | --- a/Modules/signalmodule.c | ||
25 | +++ b/Modules/signalmodule.c | ||
26 | @@ -744,7 +744,6 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) | ||
27 | int result = -1; | ||
28 | PyObject *iterator, *item; | ||
29 | long signum; | ||
30 | - int err; | ||
31 | |||
32 | sigemptyset(mask); | ||
33 | |||
34 | @@ -766,11 +765,14 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) | ||
35 | Py_DECREF(item); | ||
36 | if (signum == -1 && PyErr_Occurred()) | ||
37 | goto error; | ||
38 | - if (0 < signum && signum < NSIG) | ||
39 | - err = sigaddset(mask, (int)signum); | ||
40 | - else | ||
41 | - err = 1; | ||
42 | - if (err) { | ||
43 | + if (0 < signum && signum < NSIG) { | ||
44 | + /* bpo-33329: ignore sigaddset() return value as it can fail | ||
45 | + * for some reserved signals, but we want the `range(1, NSIG)` | ||
46 | + * idiom to allow selecting all valid signals. | ||
47 | + */ | ||
48 | + (void) sigaddset(mask, (int)signum); | ||
49 | + } | ||
50 | + else { | ||
51 | PyErr_Format(PyExc_ValueError, | ||
52 | "signal number %ld out of range", signum); | ||
53 | goto error; | ||
54 | -- | ||
55 | 2.11.0 | ||
56 | |||
diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb index 02decf470c..15ec7d7fda 100644 --- a/meta/recipes-devtools/python/python3_3.5.5.bb +++ b/meta/recipes-devtools/python/python3_3.5.5.bb | |||
@@ -41,6 +41,7 @@ SRC_URI += "\ | |||
41 | file://0002-Makefile-add-target-to-split-profile-generation.patch \ | 41 | file://0002-Makefile-add-target-to-split-profile-generation.patch \ |
42 | file://float-endian.patch \ | 42 | file://float-endian.patch \ |
43 | file://ftplib.patch \ | 43 | file://ftplib.patch \ |
44 | file://signal.patch \ | ||
44 | " | 45 | " |
45 | SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0" | 46 | SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0" |
46 | SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009" | 47 | SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009" |