I did look into this some more and I did verify that the refcounts wraps: lst [[0, 1, 2, 3, 4, 5, 6]] lst [[0], [1], [2], [3], [4], [5], [6]] lst [[0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3], [0, 4], [1, 4], [2, 4], [3, 4], [0, 5], [1, 5], [2, 5], [3, 5], [4, 5], [0, 6], [1, 6], [2, 6], [3, 6], [4, 6], [5, 6]] lst [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [0, 1, 4], [0, 2, 4], [1, 2, 4], [0, 3, 4], [1, 3, 4], [2, 3, 4], [0, 1, 5] , [0, 2, 5], [1, 2, 5], [0, 3, 5], [1, 3, 5], [2, 3, 5], [0, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5], [0, 1, 6], [0, 2, 6], [ 1, 2, 6], [0, 3, 6], [1, 3, 6], [2, 3, 6], [0, 4, 6], [1, 4, 6], [2, 4, 6], [3, 4, 6], [0, 5, 6], [1, 5, 6], [2, 5, 6], [3, 5, 6], [4, 5, 6]] lst [[<refcnt -2147483582 at 0x97550ac>, 1, 2, 3], [<refcnt -2147483582 at 0x97550ac>, 1, 2, 4], [<refcnt -2147483582 at 0x9 7550ac>, 1, 3, 4], [<refcnt -2147483582 at 0x97550ac>, 2, 3, 4], [1, 2, 3, 4], [<refcnt -2147483582 at 0x97550ac>, 1, 2, 5], [<refcnt -2147483582 at 0x97550ac>, 1, 3, 5], [<refcnt -2147483582 at 0x97550ac>, 2, 3, 5], [1, 2, 3, 5], [<refcnt -2147483 582 at 0x97550ac>, 1, 4, 5], [<refcnt -2147483582 at 0x97550ac>, 2, 4, 5], [1, 2, 4, 5], [<refcnt -2147483582 at 0x97550ac>, 3, 4, 5], [1, 3, 4, 5], [2, 3, 4, 5], [<refcnt -2147483582 at 0x97550ac>, 1, 2, 6], [<refcnt -2147483582 at 0x97550ac>, 1, 3, 6], [<refcnt -2147483582 at 0x97550ac>, 2, 3, 6], [1, 2, 3, 6], [<refcnt -2147483582 at 0x97550ac>, 1, 4, 6], [<refcnt -2 147483582 at 0x97550ac>, 2, 4, 6], [1, 2, 4, 6], [<refcnt -2147483582 at 0x97550ac>, 3, 4, 6], [1, 3, 4, 6], [2, 3, 4, 6], [ <refcnt -2147483582 at 0x97550ac>, 1, 5, 6], [<refcnt -2147483582 at 0x97550ac>, 2, 5, 6], [1, 2, 5, 6], [<refcnt -214748358 2 at 0x97550ac>, 3, 5, 6], [1, 3, 5, 6], [2, 3, 5, 6], [<refcnt -2147483582 at 0x97550ac>, 4, 5, 6], [1, 4, 5, 6], [2, 4, 5, 6], [3, 4, 5, 6]] lst [[<refcnt -2147483447 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0>, 2, 3, 4], [<refcnt -2147483447 at 0x97550ac>, <r efcnt -2147483523 at 0x97550a0>, 2, 3, 5], [<refcnt -2147483447 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0>, 2, 4, 5], [<refcnt -2147483447 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0>, 3, 4, 5], [<refcnt -2147483447 at 0x97550ac>, 2, 3, 4 , 5], [<refcnt -2147483523 at 0x97550a0>, 2, 3, 4, 5], [<refcnt -2147483447 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0> , 2, 3, 6], [<refcnt -2147483447 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0>, 2, 4, 6], [<refcnt -2147483447 at 0x97550 ac>, <refcnt -2147483523 at 0x97550a0>, 3, 4, 6], [<refcnt -2147483447 at 0x97550ac>, 2, 3, 4, 6], [<refcnt -2147483523 at 0 x97550a0>, 2, 3, 4, 6], [<refcnt -2147483447 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0>, 2, 5, 6], [<refcnt -214748344 7 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0>, 3, 5, 6], [<refcnt -2147483447 at 0x97550ac>, 2, 3, 5, 6], [<refcnt -214 7483523 at 0x97550a0>, 2, 3, 5, 6], [<refcnt -2147483447 at 0x97550ac>, <refcnt -2147483523 at 0x97550a0>, 4, 5, 6], [<refcn t -2147483447 at 0x97550ac>, 2, 4, 5, 6], [<refcnt -2147483523 at 0x97550a0>, 2, 4, 5, 6], [<refcnt -2147483447 at 0x97550ac >, 3, 4, 5, 6], [<refcnt -2147483523 at 0x97550a0>, 3, 4, 5, 6], [2, 3, 4, 5, >6]]
The crash happens when the refcount for [0] goes up to zero. I now tend to blame Cython for this, so can somebody take a closer look at the code Cython generates for _choose. I would also conjecture that these kinds of refcounting issues cause a lot of the "still reachable memory" in a valgrind run. Carl Witty suggested to turn the refcount macros into functions that jump to a predefined function in case the refcount exceeds a certain threshold like 1,000 or even 1,000,000. That way we can search for those issues and hopefully eliminate them by setting a breakpoint on that predefined function. Cheers, Michael --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---