Issue 33712: OrderedDict can set an exception in tp_clear
Created on 2018-05-31 12:08 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 7349 | merged | serhiy.storchaka, 2018-06-03 07:48 | |
| PR 10000 | merged | serhiy.storchaka, 2018-10-20 07:36 | |
| PR 10001 | merged | serhiy.storchaka, 2018-10-20 08:31 | |
| Messages (5) | |||
|---|---|---|---|
| msg318287 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-05-31 12:08 | |
The tp_clear handler of OrderedDict can set an exception when fail to allocate a nodes cache for an empty dict. An exception in tp_clear is not expected and caused a crash in the garbage collector. In the master branch it will cause just writing a traceback to stderr (see issue33622), but in any case it would be better to handle the failure locally in OrderedDict. Perhaps the cache for an empty dict is not needed. |
|||
| msg318317 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2018-05-31 14:16 | |
> The tp_clear handler of OrderedDict can set an exception when fail to allocate a nodes cache for an empty dict. An exception in tp_clear is not expected and caused a crash in the garbage collector. If it's a cache, it would be better to cancel the caching, and just destroy the dictionary, no? |
|||
| msg328082 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2018-10-19 23:27 | |
New changeset 6f17e51345d930ccb4db306acc12b7d1f6c5e690 by Victor Stinner (Serhiy Storchaka) in branch 'master': bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349) https://github.com/python/cpython/commit/6f17e51345d930ccb4db306acc12b7d1f6c5e690 |
|||
| msg328132 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-10-20 08:24 | |
New changeset 861d34eee345956cbb0940fa676bfb7ff492999d by Serhiy Storchaka in branch '3.7': bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349). (GH-10000) https://github.com/python/cpython/commit/861d34eee345956cbb0940fa676bfb7ff492999d |
|||
| msg328135 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-10-20 08:47 | |
New changeset f1b90e3922e9d218cf1f6c94ab98874c1752bdf3 by Serhiy Storchaka in branch '3.6': bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349). (GH-10001) https://github.com/python/cpython/commit/f1b90e3922e9d218cf1f6c94ab98874c1752bdf3 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:01 | admin | set | github: 77893 |
| 2018-10-20 09:10:11 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-10-20 08:47:11 | serhiy.storchaka | set | messages: + msg328135 |
| 2018-10-20 08:31:38 | serhiy.storchaka | set | pull_requests: + pull_request9343 |
| 2018-10-20 08:24:11 | serhiy.storchaka | set | messages: + msg328132 |
| 2018-10-20 07:36:18 | serhiy.storchaka | set | pull_requests: + pull_request9342 |
| 2018-10-19 23:27:50 | vstinner | set | messages: + msg328082 |
| 2018-06-03 07:48:26 | serhiy.storchaka | set | keywords:
+ patch stage: patch review pull_requests: + pull_request6975 |
| 2018-05-31 14:16:40 | vstinner | set | nosy:
+ vstinner messages: + msg318317 |
| 2018-05-31 12:08:48 | serhiy.storchaka | create | |
