diff options
| author | Mark Asselstine <mark.asselstine@windriver.com> | 2017-07-14 10:01:09 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-21 22:51:37 +0100 |
| commit | 17d181f0590b37df2ca5ee2ff1ab6db343b62f33 (patch) | |
| tree | 17be1bc7143954162916d2039cc7881f765431e0 | |
| parent | 9e25a095e1173a089f647825f3ed58e4993eb66f (diff) | |
| download | poky-17d181f0590b37df2ca5ee2ff1ab6db343b62f33.tar.gz | |
python3: fix weakref spewing exceptions during interp finalization
When py3 applications are exiting we often see errors similar to the
following:
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fcb56b09400>
Traceback (most recent call last):
File "/usr/lib64/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
After a quick search this was found to be a well reported issue
upstream and had an appropriate fix which is backported here.
(From OE-Core rev: 8aaf09a916a2f66f1a6a79cbddf45390ecefde4f)
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/python/python3/Fix-29519-weakref-spewing-exceptions-during-interp-f.patch | 56 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3_3.5.3.bb | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/Fix-29519-weakref-spewing-exceptions-during-interp-f.patch b/meta/recipes-devtools/python/python3/Fix-29519-weakref-spewing-exceptions-during-interp-f.patch new file mode 100644 index 0000000000..7217c6edea --- /dev/null +++ b/meta/recipes-devtools/python/python3/Fix-29519-weakref-spewing-exceptions-during-interp-f.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | From 62dcf34987b680e95873eb947b3f4d802199c667 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?=C5=81ukasz=20Langa?= <lukasz@langa.pl> | ||
| 3 | Date: Fri, 10 Feb 2017 00:14:55 -0800 | ||
| 4 | Subject: [PATCH] Fix #29519: weakref spewing exceptions during interp | ||
| 5 | finalization | ||
| 6 | |||
| 7 | commit 9cd7e17640a49635d1c1f8c2989578a8fc2c1de6 | ||
| 8 | from https://github.com/python/cpython | ||
| 9 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | |||
| 12 | Signed-off-by: Lukasz Langa <lukasz@langa.pl> | ||
| 13 | --- | ||
| 14 | Lib/weakref.py | 4 ++-- | ||
| 15 | Misc/NEWS | 3 +++ | ||
| 16 | 2 files changed, 5 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/Lib/weakref.py b/Lib/weakref.py | ||
| 19 | index aaebd0c..787e33a 100644 | ||
| 20 | --- a/Lib/weakref.py | ||
| 21 | +++ b/Lib/weakref.py | ||
| 22 | @@ -106,7 +106,7 @@ class WeakValueDictionary(collections.MutableMapping): | ||
| 23 | self, *args = args | ||
| 24 | if len(args) > 1: | ||
| 25 | raise TypeError('expected at most 1 arguments, got %d' % len(args)) | ||
| 26 | - def remove(wr, selfref=ref(self)): | ||
| 27 | + def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref): | ||
| 28 | self = selfref() | ||
| 29 | if self is not None: | ||
| 30 | if self._iterating: | ||
| 31 | @@ -114,7 +114,7 @@ class WeakValueDictionary(collections.MutableMapping): | ||
| 32 | else: | ||
| 33 | # Atomic removal is necessary since this function | ||
| 34 | # can be called asynchronously by the GC | ||
| 35 | - _remove_dead_weakref(d, wr.key) | ||
| 36 | + _atomic_removal(d, wr.key) | ||
| 37 | self._remove = remove | ||
| 38 | # A list of keys to be removed | ||
| 39 | self._pending_removals = [] | ||
| 40 | diff --git a/Misc/NEWS b/Misc/NEWS | ||
| 41 | index 41cfdba..6d89f52 100644 | ||
| 42 | --- a/Misc/NEWS | ||
| 43 | +++ b/Misc/NEWS | ||
| 44 | @@ -5719,6 +5719,9 @@ Core and Builtins | ||
| 45 | Library | ||
| 46 | ------- | ||
| 47 | |||
| 48 | +- Issue #29519: Fix weakref spewing exceptions during interpreter shutdown | ||
| 49 | + when used with a rare combination of multiprocessing and custom codecs. | ||
| 50 | + | ||
| 51 | - Issue #20154: Deadlock in asyncio.StreamReader.readexactly(). | ||
| 52 | |||
| 53 | - Issue #16113: Remove sha3 module again. | ||
| 54 | -- | ||
| 55 | 2.7.4 | ||
| 56 | |||
diff --git a/meta/recipes-devtools/python/python3_3.5.3.bb b/meta/recipes-devtools/python/python3_3.5.3.bb index d7c29f2f7d..7419c71515 100644 --- a/meta/recipes-devtools/python/python3_3.5.3.bb +++ b/meta/recipes-devtools/python/python3_3.5.3.bb | |||
| @@ -37,6 +37,7 @@ SRC_URI += "\ | |||
| 37 | file://configure.ac-fix-LIBPL.patch \ | 37 | file://configure.ac-fix-LIBPL.patch \ |
| 38 | file://upstream-random-fixes.patch \ | 38 | file://upstream-random-fixes.patch \ |
| 39 | file://0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch \ | 39 | file://0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch \ |
| 40 | file://Fix-29519-weakref-spewing-exceptions-during-interp-f.patch \ | ||
| 40 | " | 41 | " |
| 41 | SRC_URI[md5sum] = "57d1f8bfbabf4f2500273fb0706e6f21" | 42 | SRC_URI[md5sum] = "57d1f8bfbabf4f2500273fb0706e6f21" |
| 42 | SRC_URI[sha256sum] = "eefe2ad6575855423ab630f5b51a8ef6e5556f774584c06beab4926f930ddbb0" | 43 | SRC_URI[sha256sum] = "eefe2ad6575855423ab630f5b51a8ef6e5556f774584c06beab4926f930ddbb0" |
