[New-bugs-announce] [issue16445] SEGFAULT when deleting Exception.message

Amaury Forgeot d'Arc report at bugs.python.org
Fri Nov 9 00:05:10 CET 2012


New submission from Amaury Forgeot d'Arc:

The script below segfaults cpython2.7. 
The cause is in BaseException_set_message(), which calls Py_XDECREF(self->message) and thus can call back into Python code with a dangling PyObject* pointer. Py_CLEAR should be used instead.


class Nasty(str):
    def __del__(self):
        del e.message

e = ValueError(Nasty("msg"))
e.args = ()
del e.message
del e

----------
messages: 175203
nosy: amaury.forgeotdarc
priority: normal
severity: normal
status: open
title: SEGFAULT when deleting Exception.message
type: crash

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16445>
_______________________________________


More information about the New-bugs-announce mailing list