On Monday, December 31, 2012 6:49:03 PM UTC+1, Jean-Pierre Flori wrote: > > > > On Monday, December 31, 2012 6:36:16 PM UTC+1, Nils Bruin wrote: >> >> On Dec 31, 8:46 am, Jean-Pierre Flori <jpfl...@gmail.com> wrote: >> > Of course, if Nils is right, it might not be up to us to solve such >> > problems, but rather Python itself... >> >> It might by cython, not python: >> >> A little grepping in the Python source shows that the first thing >> dealloc methods do is call _PyObject_GC_UNTRACK and then call >> PyObject_ClearWeakRefs. Cython generated code leaves out the >> _PyObject_GC_UNTRACK. Probably cython should untrack its objects upon >> deallocation as well. That sounds like exactly the kind of thing that >> would prevent the object from being marked for deallocation a second >> time. >> > Indeed (or at least), adding a _PyObject_GC_UNTRACK(o) in the dealloc > method of category_object makes the segfault go away. > This might indeed be a good fix to include. See http://docs.python.org/2/c-api/gcsupport.html, especially http://docs.python.org/2/c-api/gcsupport.html#PyObject_GC_UnTrack Not sure though how to decide what a container is.
> >> (mind you, TripleDictEraser needs fixing anyway. I think this shows >> callbacks should be extremely careful in issuing delete instructions >> on objects that are not solely under their control) >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To post to this group, send email to sage-devel@googlegroups.com. To unsubscribe from this group, send email to sage-devel+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en.