[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Georg Brandl
Georg Brandl added the comment: OK, committed in r88443 (with error handling made more consistent). BTW, the return from PyType_GenericAlloc isn't NULL-checked, which looks like a potential crasher to me. Not release-critical though. -- resolution: -> fixed status: open -> closed _

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: >> That tp_doc will be copied is currently undocumented. PyType_FromSpec >> is documented in the PEP. > > I meant all of py_tp_doc, "limited api", "restricted api" show almost > zero hits in the API docs. A PEP is nice but I'm not sure many people > spontaneou

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > >>> Sounds like a blocker to me. Martin, will you be able to provide a patch > >>> before final? > >> > >> The attached patch works fine for me. > > > > Is there some documentation somewhere for all this? > > Can you please be more specific? What's "all th

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: >>> Sounds like a blocker to me. Martin, will you be able to provide a patch >>> before final? >> >> The attached patch works fine for me. > > Is there some documentation somewhere for all this? Can you please be more specific? What's "all this"? That tp_d

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Sounds like a blocker to me. Martin, will you be able to provide a patch > > before final? > > The attached patch works fine for me. Is there some documentation somewhere for all this? -- ___ Python tracker

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: > Sounds like a blocker to me. Martin, will you be able to provide a patch > before final? The attached patch works fine for me. -- ___ Python tracker

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: > Well, isn't Py_tp_doc characteristically bound to a constant char * That's exactly the problem: PyType_FromSpec puts in this string literal. When the type is later released, PyObject_Free is called in type_dealloc, which segfaults. -- _

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Georg Brandl
Georg Brandl added the comment: Sounds like a blocker to me. Martin, will you be able to provide a patch before final? -- ___ Python tracker ___ __

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, isn't Py_tp_doc characteristically bound to a constant char *, so that the problem doesn't manifest itself? -- ___ Python tracker ___ __

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: If this isn't added, people using the API might see crashes. If they then work around crashes, they will see memory leaks in future releases. -- ___ Python tracker _

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sure it should be a blocker? -- nosy: +georg.brandl, pitrou ___ Python tracker ___ ___ Python-bugs-

[issue11249] Memory mismanagement with Py_tp_doc

2011-02-19 Thread Martin v . Löwis
New submission from Martin v. Löwis : Currently, memory management for the Py_tp_doc slot in PyType_FromSpec is ill-defined. The doc string being passed is stored in the type object as-is, but later released with PyObject_Free. To make this consistent, PyType_FromSpec should copy the string, s