On Monday, December 31, 2012 5:32:05 PM UTC+1, Nils Bruin wrote:
>
> On Dec 31, 7:29 am, Nils Bruin <nbr...@sfu.ca> wrote: 
>
> > I am not sure that this is exactly the issue we're running into, but 
> > it seems plausible (it certainly needs a very brittle confluence of 
> > circumstances to become apparent). Furthermore, I think it is a 
> > scenario that does need addressing, because TripleDictEraser doesn't 
> > seem to guard against this. 
>
> In fact, upon further inspection, I don't think this issue is what 
> bites us here. The dictionary in question only contains weakrefs in 
> its values. 
>
> I now believe this is a genuine bug in Python. We don't have a good 
> testcase, though, so I don't know how to report. However, as you see 
> in the traceback: 
>
> #0  PyObject_Free (p=0x7fffbeb3e330) at Objects/obmalloc.c:981 
> #1  0x00007ffff7cc7b76 in subtype_dealloc (self=0x7fffbeb3e350) at 
> Objects/typeobject.c:1014 
> #2  0x00007ffff7d4b7ca in delete_garbage (old=0x7ffff7fe19e0, 
> collectable=0x7fffffffafb0) at Modules/gcmodule.c:770 
> #3  collect (generation=1) at Modules/gcmodule.c:930 
> #4  0x00007ffff7d4c1a8 in collect_generations () at Modules/ 
> gcmodule.c: 
> 996 
> #5  _PyObject_GC_Malloc (basicsize=<optimized out>) at Modules/ 
> gcmodule.c:1457 
> #6  _PyObject_GC_Malloc (basicsize=<optimized out>) at Modules/ 
> gcmodule.c:1439 
> #7  0x00007ffff7d4c1cd in _PyObject_GC_New (tp=0x7ffff7fb7d00) at 
> Modules/gcmodule.c:1467 
> #8  0x00007ffff7c86cb8 in PyWrapper_New (d=0x7ffff7bce230, 
> self=0xb2eca0) at Objects/descrobject.c:1068 
>
> (this is below the TripleDictEraser call). What you see is that during 
> our callback, a garbage collection is triggered! This of course 
> discovers all sorts of things that can be deleted, including things 
> that are already scheduled for deletion. Other interpretations would 
> be very welcome. 
>
It seems very plausible, whence the possible need to look at Py_Clear.

The difference between the "del A[1]" and "A.__delitem__(1)" might only be 
the fact that in the latter case (where more fucntions calls are performed) 
a gc is triggered whereas its not in the first case, that's just a wild 
guess though.

-- 
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.


Reply via email to