[Stackless] Porting to 2.2.3

Giovanni Bajo giovannibajo at libero.it
Wed Aug 20 14:49:00 CEST 2003


Hello everybody, hello Christian,

I'm trying to port stackless to 2.2.3. I diff'd the CVS version against a
standard 2.2.2 distribution and applied the patch to 2.2.3 (and it applied
flawlessly, modulo a small hunk in the .dsw project due to build numbers,
which I fixed manually).

The problem is, it crashes at startup. Tracing in the debugger, the crash
happens because init_slpmoduletype() fails and the error is probably not
correctly propagated (pythonrun.c does not expect _PyStackless_Init() to
fail). The failure happens because of the way _PySlpModule_Type is defined.
In fact, there is this new sanity check in 2.2.3, within typeobject.c:

 /* Sanity check for tp_free. */
 if (PyType_IS_GC(type) && (type->tp_flags & Py_TPFLAGS_BASETYPE) &&
     (type->tp_free == NULL || type->tp_free == _PyObject_Del)) {
      /* This base class needs to call tp_free, but doesn't have
       * one, or its tp_free is for non-gc'ed objects.
       */
  PyErr_Format(PyExc_TypeError, "type '%.100s' participates in "
        "gc and is a base type but has inappropriate "
        "tp_free slot",
        type->tp_name);
  goto error;
 }

and this is triggered for _PySlpModule_Type. There are some comments about
it here: http://www.python.org/2.2.3/NEWS.txt (changes for 2.2.3rc1, the
first change) and the checkin can be seen here:
http://mail.python.org/pipermail/python-checkins/2003-May/036122.html.

Sadly I don't have a clue about type system in Python (nor anything else in
the core), so I don't know how to fix this. Right now, tp_free within
_PySlpModule_Type is 0. I tried putting _PyObject_Del and _PyObject_GC_Del
in there, but nothing changes. Is there any way I can work around this?
Right now, I have commented out the above check, and python seems to work
correctly (I haven't run any testsuite yet, but it looks ok).

Christian, if you want I can send you the stackless.diff I produces and/or
the full 2.2.3+stackless source tree I have here. I know you have different
priorities right now ($$$), but I'm just trying to help Stackless the way
I'm able to. About the 2.3 port, I know it's much harder and I probably
won't switch to 2.3 until 2.3.1 anyway, so if making 2.2.3 works is only a
matter of fixing the above problem, I'd say why not.

Thanks
Giovanni Bajo


_______________________________________________
Stackless mailing list
Stackless at www.tismer.com
http://www.tismer.com/mailman/listinfo/stackless




More information about the Stackless mailing list