[Python-Dev] test_subprocess and sparc buildbots

Georg Brandl g.brandl at gmx.net
Thu Jan 1 15:20:30 CET 2009


Alexandre Vassalotti schrieb:
> On Tue, Dec 30, 2008 at 10:41 PM, Daniel (ajax) Diniz <ajaksu at gmail.com> wrote:
>> A reliable way to get that in a --with-pydebug build seems to be:
>>
>> ~/py3k$ ./python -c "import locale; locale.format_string(1,1)"
>> * ob
>> object  : <refcnt 0 at 0x825c76c>
>> type    : tuple
>> refcount: 0
>> address : 0x825c76c
>> * op->_ob_prev->_ob_next
>> NULL
>> * op->_ob_next->_ob_prev
>> object  : <refcnt 0 at 0x825c76c>
>> type    : tuple
>> refcount: 0
>> address : 0x825c76c
>> Fatal Python error: UNREF invalid object
>> TypeError: expected string or buffer
>> Aborted
>>
> 
> Nice catch! I reduced your example to: "import _sre;  _sre.compile(0,
> 0, [])". And, it doesn't seem to be an input validation problem with
> _sre. From what I saw, it's actually a bug in Py_TRACE_REFS's code.
> Now, it's getting interesting!
> 
> It seems something is breaking the refchain. However, I don't know
> what is causing the problem exactly.

This only occurs --with-pydebug, I assume?

It is the same basic problem as in http://bugs.python.org/issue3299,
which I analysed some time ago.  Simply speaking, it is caused by
the object allocation and deallocation scheme that _sre chooses:
if _compile's argument processing raises an error, PyObject_DEL is
called which doesn't remove the object from the refchain.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list