[New-bugs-announce] [issue33714] module can set an exception in tp_clear

Serhiy Storchaka report at bugs.python.org
Thu May 31 08:21:45 EDT 2018


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

The tp_clear handler of the module object calls a custom clear function if the PyModuleDef.m_clear field is set. This function can set an exception which will be leaked to the garbage collector. 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 the module's tp_clear.

----------
components: Interpreter Core
messages: 318289
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: module can set an exception in tp_clear
type: crash
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33714>
_______________________________________


More information about the New-bugs-announce mailing list