Message25613
Logged In: YES
user_id=6656
At this point you might be thinking that Py_NewInterpreter/
Py_EndInterpreter loops are not the best tested things in the world. You'd
be right.
Neil's fix *does* fix the crash, but also shares PyObject's between
interpreter states, which is a bit of a no-no, but otoh, this problem is far
from unique to gcmodule.c.
> besides: the incref is only in gcinit, but the list can be
> created in gcinit OR in handle_finalizers (and while i was
> looking at it in the debugger it always was handle_finalizers).
That slightly misses the point -- the reason you got a crash was because
the PyModule_AddObject initgc stole a reference to garbage, so when the
module got cleaned up, it got deallocated despite there still being a
reference to it in the module level global. If initgc is never run, the
refcount of garbage stays at 1.
> i guess the proper way to fix it would be a cleanup function
> for the gcmodule that is called by Py_Finalize.
Yeah, but quite a lot of modules could do with that, I think. Do you have
the energy to work on a 'proper' solution? I don't. |
|
Date |
User |
Action |
Args |
2007-08-23 14:32:35 | admin | link | issue1225584 messages |
2007-08-23 14:32:35 | admin | create | |
|