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 <>
Python-bugs-list mailing list

Reply via email to