[Python-Dev] RE: [Zope-Coders] core dump in Zope 2.7 test suite

Tim Peters tim at zope.com
Tue Sep 16 13:11:13 EDT 2003

>> Not a small test case, no, but I have boiled it down a bit.  If you
>> run the tests from a Zope checkout on the Zope-2_7-branch, you can
>> provoke the crash with "test.py Template."

> Sorry, I cannot.  I tried a fresh Zope-2_7-branch, on Windows, with
>     released Python 2.3, release build
>     current CVS Python, release build
>     current CVS Python, debug build
> "test.py Template" gave the same result in all cases:  77 tests run, 1
> failure (AssertionError: HTML Output Changed) in
> checkStringExpressions.
> But note that Py_UNICODE is unsigned short on this box, and reading a
> trash one of those as an index isn't nearly as likely to reach into
> unmapped memory as on a box where you get 4 bytes of trash.

What I *could* do, though, is add this to unicode_resize():

    if (unicode != unicode_empty && unicode->length == 1) {
        assert(unicode->str[0] != 0xcbcbU);

That checks for the debug pymalloc's "uninitialized memory" byte pattern
appropriate for this box, and that assert does indeed trigger when running

    test.py Template

It fires while running checkUnicodeInserts, but checkUnicodeInserts does not
fail in isolation.  So checkUnicodeInserts is the victim of something an
earlier test left on the unicode freelist.

More information about the Python-Dev mailing list