]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44348: BaseException deallocator uses trashcan (GH-28190)
authorVictor Stinner <vstinner@python.org>
Tue, 7 Sep 2021 13:42:11 +0000 (15:42 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Sep 2021 13:42:11 +0000 (15:42 +0200)
commitfb305092a5d7894b41f122c1a1117b3abf4c567e
treebaaf648325e8226eccbd54b702b2f0e08c616237
parent979336de34e3d3f40cf6e666b72a618f6330f3c1
bpo-44348: BaseException deallocator uses trashcan (GH-28190)

The deallocator function of the BaseException type now uses the
trashcan mecanism to prevent stack overflow. For example, when a
RecursionError instance is raised, it can be linked to another
RecursionError through the __context__ attribute or the __traceback__
attribute, and then a chain of exceptions is created. When the chain
is destroyed, nested deallocator function calls can crash with a
stack overflow if the chain is too long compared to the available
stack memory.
Misc/NEWS.d/next/Core and Builtins/2021-09-07-00-21-04.bpo-44348.f8w_Td.rst [new file with mode: 0644]
Objects/exceptions.c