summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-09-07 13:42:11 (GMT)
committerGitHub <noreply@github.com>2021-09-07 13:42:11 (GMT)
commitfb305092a5d7894b41f122c1a1117b3abf4c567e (patch)
treebaaf648325e8226eccbd54b702b2f0e08c616237 /Misc
parent979336de34e3d3f40cf6e666b72a618f6330f3c1 (diff)
downloadcpython-fb305092a5d7894b41f122c1a1117b3abf4c567e.zip
cpython-fb305092a5d7894b41f122c1a1117b3abf4c567e.tar.gz
cpython-fb305092a5d7894b41f122c1a1117b3abf4c567e.tar.bz2
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2021-09-07-00-21-04.bpo-44348.f8w_Td.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-09-07-00-21-04.bpo-44348.f8w_Td.rst b/Misc/NEWS.d/next/Core and Builtins/2021-09-07-00-21-04.bpo-44348.f8w_Td.rst
new file mode 100644
index 0000000..c222a07
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2021-09-07-00-21-04.bpo-44348.f8w_Td.rst
@@ -0,0 +1,8 @@
+The deallocator function of the :exc:`BaseException` type now uses the
+trashcan mecanism to prevent stack overflow. For example, when a
+:exc:`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. Patch by Victor Stinner.