Santoso Wijaya <santoso.wij...@gmail.com> added the comment:

Regarding the crash,

>From what I can see, the `tp_clear` method of bufferedrwpair is called during 
>Py_Finalize() that leads to garbage collection. This NULLs `self->writer` for 
>the rwpair object.

Later, in the same garbage collection routine, the `tp_clear` of textio (the 
wrapper) is called. This attempts to finalize its wrapped object by first 
calling the `closed` property of the wrapped object. This property read is 
propagated down to the wrapped bufferedrwpair, `bufferedrwpair_closed_get()`.

At this point, `self->writer` for the bufferedrwpair object is already NULL 
from the previous clear. Hence, the crash happens because a NULL pointer 
dereferencing is attempted.

----------
nosy: +santa4nt

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12340>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to