Python-2.5beta1 crash

"Martin v. Löwis" martin at v.loewis.de
Wed Jul 12 02:44:43 EDT 2006


Robin Becker wrote:
> First off there may be a bunch of other C extensions involved including
> PIL, but I built them all against this beta. What should I do to refine
> the error? Do I start with trying to establish which of the tests is
> guilty or build from source in debug mode and attempt to find the
> problem from below.

I would personally run Python in debug mode. Set a break point on
Py_FatalError, and then walk the C stack to see where it comes from.

Of course, the specific error comes from

static void
intern_strings(PyObject *tuple)
{
        Py_ssize_t i;

        for (i = PyTuple_GET_SIZE(tuple); --i >= 0; ) {
                PyObject *v = PyTuple_GET_ITEM(tuple, i);
                if (v == NULL || !PyString_CheckExact(v)) {
                        Py_FatalError("non-string found in code slot");
                }
                PyString_InternInPlace(&PyTuple_GET_ITEM(tuple, i));
        }
}

which in turn is called from PyCode_New, in these calls:

        intern_strings(names);
        intern_strings(varnames);
        intern_strings(freevars);
        intern_strings(cellvars);

So it appears you are trying to create a code object, where
a name, varname, freevar name, or cellvar name is not a string.
This is indeed fatal: names in Python are always strings.

Regards,
Martin



More information about the Python-list mailing list