Stefan Behnel added the comment:

I'm witnessing a crash in the C implementation during garbage collection. 
Interestingly, it only shows in the Py3.6 branch, not in Py3.5 (both latest). 
Here's the gdb session:

Program received signal SIGSEGV, Segmentation fault.
lru_cache_tp_traverse (self=0x7ffff2a80ae8, visit=0x43c528 <visit_decref>, 
arg=0x0) at ./Modules/_functoolsmodule.c:1040
1040            lru_list_elem *next = link->next;
(gdb) list
1035    static int
1036    lru_cache_tp_traverse(lru_cache_object *self, visitproc visit, void 
*arg)
1037    {
1038        lru_list_elem *link = self->root.next;
1039        while (link != &self->root) {
1040            lru_list_elem *next = link->next;
1041            Py_VISIT(link);
1042            link = next;
1043        }
1044        Py_VISIT(self->maxsize_O);
(gdb) print link
$1 = (lru_list_elem *) 0x0
(gdb) print self
$2 = (lru_cache_object *) 0x7ffff2a80ae8
(gdb) print self->root.next
$3 = (struct lru_list_elem *) 0x0
(gdb) print self->root
$4 = {ob_base = {_ob_next = 0x7ffff2a26458, _ob_prev = 0x90e860 <refchain>, 
ob_refcnt = 1, ob_type = 0x92c500 <lru_cache_type>}, prev = 0x0, next = 0x0, 
key = 0x0, result = 0x0}

IIUC correctly, there is only one entry and the code doesn't expect that. An 
additional "is empty?" NULL check may or may not be the right fix. It might 
also be the linking itself that's incorrect here. The code seems to expect a 
cyclic data structure which is apparently not maintained that way.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14373>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to