Closed vbraun closed 11 years ago
No patches were changed, only the dependencies. One of the patches on #715 ensures that the problem that #13447 solves doesn't occur, so this ticket should be safe while only depending on #715, #11521.
Changed dependencies from #13447 to #11521
When applying this on top of sage-5.5.beta0 (not released), I get doctest failures in sage/crypto/mq
. I'll investigate further and report back.
I [edit:] cannot quite confirm that
sage -t "devel/sage-main/sage/crypto/mq/mpolynomialsystem.py"
on sage-5.5.beta0+#12215 on sage.math does not succeed. In fact, when I run it, I usually get "Connection to sage.math.washington.edu closed by remote host.". A screen session doesn't help either, since that gets killed too.
It seems to hang somewhere around line 971 (that's the last I see from sage -t --verbose
), which is in the doctesting of "coefficient_matrix". Running that doctest by itself doesn't cause any problems.
Oops, I had one run now where my connection wasn't closed! I got a " TIMED OUT! PROCESS KILLED!" this time.
And in fact, the "connection closed" thing seems to happen quite a bit, so I don't think I have confirmation that there's really a bug. It may be that sage.math is just flaky.
Replying to @nbruin:
And in fact, the "connection closed" thing seems to happen quite a bit, so I don't think I have confirmation that there's really a bug. It may be that sage.math is just flaky.
Maybe your ssh program is flaky?
Rebased patch because it applied with fuzz.
Irrelevant remark: you might replace trac ticket 12215
in documentation by :trac:`12215`
.
OK, the "connection lost" problem was resolved by rm -rf ~/.sage
. I don't know what was screwed up, but something there was making any sage session very prone to terminating the whole connection.
It seems that line 971 in mpolynomialsystem.py
is indeed a problematic doctest. It seems to hang. When I run the doctest in gdb
I can interrupt and get a traceback (first bit):
#0 0x00007fb5259748aa in PyObject_Free (p=0x57d0300) at Objects/obmalloc.c:969
#1 0x00007fb525985dcc in PyTuple_ClearFreeList () at Objects/tupleobject.c:916
#2 0x00007fb525a0d5cb in collect (generation=2) at Modules/gcmodule.c:792
#3 0x00007fb525a0d87e in _PyObject_GC_Malloc (basicsize=<value optimized out>) at Modules/gcmodule.c:996
#4 0x00007fb525a0d92d in _PyObject_GC_New (tp=0x7fb525c801a0) at Modules/gcmodule.c:1467
#5 0x00007fb52595e64c in PyList_New (size=0) at Objects/listobject.c:142
#6 0x00007fb51c6c47e5 in __pyx_pw_4sage_9structure_11coerce_dict_10TripleDict_1__init__ (__pyx_v_self=0xf7abc50,
__pyx_args=<value optimized out>, __pyx_kwds=<value optimized out>) at sage/structure/coerce_dict.c:1440
#7 0x00007fb5259885a8 in type_call (type=<value optimized out>, args=0xf714d0, kwds=0x0) at Objects/typeobject.c:735
#8 0x00007fb52592c308 in PyObject_Call (func=0x7fb51c8d1620, arg=0xf714d0, kw=0x0) at Objects/abstract.c:2529
#9 0x00007fb51cf2d550 in __pyx_f_4sage_9structure_6parent_6Parent_init_coerce (__pyx_v_self=0x4acacf0,
__pyx_optional_args=<value optimized out>) at sage/structure/parent.c:5757
#10 0x00007fb51d17176b in __pyx_f_4sage_9structure_10parent_old_6Parent_init_coerce (__pyx_v_self=0x57d0300,
__pyx_optional_args=<value optimized out>) at sage/structure/parent_old.c:1638
so it seems TripleDict
is implicated. I've tried it a couple of times and the tracebacks are not completely identical all the time, but the collect (generation=2)
always seems to be there. So either the system gets stuck in a loop in which it is spending a large percentage of the time in collect
or somehow collect
itself gets caught in an infinite loop. I guess instrumenting TripleDict to see what it's chewing on is most likely to resolve this one (anything below seems python library).
Of course this is another heisenbug: If I take the doctesting python file that gets produced, ~/.sage/tmp/mpolynomialsystem_*.py
and run that through python via
$ ./sage -sh
$ python ~/.sage/tmp/mpolynomialsystem_*.py
the doctest succeeds, which is weird, because that is exactly what sage-doctest
is supposed to run too.
FWIW, with #12313 doctests pass, so perhaps we should just merge them together?
Changed dependencies from #11521 to #11521, merge with #12313
Changed dependencies from #11521, merge with #12313 to #11521, #13741, merge with #12313
This had a positive review, however I think one can not realistically expect it will soon go in: It depends on other tickets, that have a tendency to uncover nasty problems.
Hence, I suggest to cut it into smaller pieces - one of them being the Pari deallocation, that is now the new dependency #13741. The second patch thus needs to be rebased.
Work Issues: rebase rel #13741
Replying to @simon-king-jena:
Hence, I suggest to cut it into smaller pieces - one of them being the Pari deallocation, that is now the new dependency #13741. The second patch thus needs to be rebased.
I just did that rebase for the sage-combinat queue (by removing the two relevant hunks), uploaded the updated patch here and tentatively set this ticket back to needs review.
Changed work issues from rebase rel #13741 to none
Implement a weak version of cached_function, and use it for UniqueRepresentation
. Properly use WeakValueDictionary
in UniqueFactory
. Combined patch
Attachment: trac12215_weak_cached_function_combined.patch.gz
I have combined the two patches into one. I haven't tested it yet, but will do in Sage's debug version.
Apply trac12215_weak_cached_function_combined.patch
Description changed:
---
+++
@@ -23,6 +23,5 @@
__Apply__
-* [attachment: trac12215_weak_cached_function-sk.patch](https://github.com/sagemath/sage/files/ticket12215/trac12215_weak_cached_function-sk.patch.gz)
-* [attachment: trac12215_segfault_fixes.patch](https://github.com/sagemath/sage/files/ticket12215/trac12215_segfault_fixes.patch.gz)
+[attachment: trac12215_weak_cached_function_combined.patch](https://github.com/sagemath/sage-prod/files/10654390/trac12215_weak_cached_function_combined.patch.gz)
FWIW: In sage-5.6.rc0 built with SAGE_DEBUG=yes (see #13864) plus #12215 plus #12313, all doctests pass on my x86_64 openSuse
12.1 laptop with MALLOC_CHECK_=3
.
Replying to @nbruin:
It seems that line 971 in
mpolynomialsystem.py
is indeed a problematic doctest. It seems to hang.
That behaviour is entirely consistent with a double free (and hence a circular freelist) that we solved in #13896. So, back to positive review from me!
Changed dependencies from #11521, #13741, merge with #12313 to merge with #12313 and #13378
Changed dependencies from merge with #12313 and #13378 to merge with #12313
Changed dependencies from merge with #12313 to none
We only introduced a codependence on #12313 because of comment [comment:133]. In view of comment [comment:141] I suspect the source of the problem noted in comment [comment:131] was actually solved, rather than hidden by merging tickets together.
Hence, I propose that this ticket is considered without dependencies and be considered for merging in sage-5.7 anyway.
Replying to @nbruin:
We only introduced a codependence on #12313 because of comment [comment:133]. In view of comment [comment:141] I suspect the source of the problem noted in comment [comment:131] was actually solved, rather than hidden by merging tickets together.
Hence, I propose that this ticket is considered without dependencies and be considered for merging in sage-5.7 anyway.
Just to have a second opinion: Simon, do you agree?
Replying to @jdemeyer:
Replying to @nbruin:
We only introduced a codependence on #12313 because of comment [comment:133]. In view of comment [comment:141] I suspect the source of the problem noted in comment [comment:131] was actually solved, rather than hidden by merging tickets together.
Hence, I propose that this ticket is considered without dependencies and be considered for merging in sage-5.7 anyway.
Just to have a second opinion: Simon, do you agree?
Yes. Note also comment:52: It used to be the case that both #12215 and #12313 were fine separately, but problems occurred when they were used together. But in later patch versions or Sage versions, it was observed that having them together makes the Heisenbug magically disappear - and the suggestion to merge them together was based on this observation.
Now it very much seems that the Cython upgrade was enough to fix the crashes. We should of course verify that no problems occur when #12215 is merged without #12313, but I think there is no reason to merge #12215 and #12313 together.
With #12215+#13378 but without #12313:
sage -t -force_lib devel/sage/sage/schemes/elliptic_curves/heegner.py
------------------------------------------------------------------------
/release/merger/sage-5.7.beta0/local/lib/libcsage.so(print_backtrace+0x2b)[0x2b9501a4093d]
/release/merger/sage-5.7.beta0/local/lib/libcsage.so(sigdie+0x34)[0x2b9501a40ae4]
/release/merger/sage-5.7.beta0/local/lib/libcsage.so(sage_signal_handler+0x15b)[0x2b9501a40317]
/lib/libpthread.so.0[0x2b94ffa697d0]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/coerce_dict.so[0x2b9508ca14b6]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/coerce_dict.so[0x2b9508ca1ee6]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_CallFunctionObjArgs+0x161)[0x2b94ff6be631]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_ClearWeakRefs+0x44a)[0x2b94ff728b4a]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/category_object.so[0x2b9508656a38]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff719e01]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff716681]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff716681]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6fd66b]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff719e5c]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/categories/functor.so[0x2b95099ab54e]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6ee447]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6ee447]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/coerce_dict.so[0x2b9508c9a967]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff79d13d]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(_PyObject_GC_Malloc+0xee)[0x2b94ff79d89e]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(_PyObject_GC_New+0xd)[0x2b94ff79d94d]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyDict_New+0xcd)[0x2b94ff6fcffd]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/libs/pari/gen.so[0x2b950b87c3e9]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/libs/pari/gen.so[0x2b950b8df1da]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/libs/pari/gen.so[0x2b950b870eaa]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6ecb3e]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6f156d]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6f1b0b]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff7185a8]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/libs/pari/gen.so[0x2b950b873c3e]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/rings/polynomial/polynomial_rational_flint.so[0x2b9514ecad42]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/rings/polynomial/polynomial_rational_flint.so[0x2b9514ecf271]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff7185a8]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x37bf)[0x2b94ff76103f]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6e99b9]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6cc8bf]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/coerce_maps.so[0x2b950fe80b58]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/parent.so[0x2b9508434031]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/rings/number_field/number_field_element.so[0x2b95183388a5]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff7177dc]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56)[0x2b94ff75cb26]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6d8b53]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/rings/number_field/number_field_element_quadratic.so[0x2b95185aa867]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff7185a8]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1299)[0x2b94ff75eb19]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6e99b9]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6cc8bf]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/coerce_maps.so[0x2b950fe80b58]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/parent.so[0x2b9508434031]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56)[0x2b94ff75cb26]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff75a238]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5de2)[0x2b94ff763662]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6e99b9]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6cc8bf]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/rings/residue_field.so[0x2b951cd4a7b5]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6cc8bf]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/factory.so[0x2b951431ab1d]
/release/merger/sage-5.7.beta0/local/lib/python/site-packages/sage/structure/factory.so[0x2b9514317940]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1299)[0x2b94ff75eb19]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x69c5)[0x2b94ff764245]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x2b94ff765472]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x714e)[0x2b94ff7649ce]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6e99b9]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6cc8bf]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1299)[0x2b94ff75eb19]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6e99b9]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6cc8bf]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1299)[0x2b94ff75eb19]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6e99b9]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0[0x2b94ff6cc8bf]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyObject_Call+0x68)[0x2b94ff6bc308]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1299)[0x2b94ff75eb19]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ae4)[0x2b94ff763364]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x852)[0x2b94ff765352]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x2b94ff765472]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyRun_FileExFlags+0xc1)[0x2b94ff7891f1]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0x1f9)[0x2b94ff7894c9]
/release/merger/sage-5.7.beta0/local/lib/libpython2.7.so.1.0(Py_Main+0xb15)[0x2b94ff79c115]
/lib/libc.so.6(__libc_start_main+0xf4)[0x2b950031e1f4]
python[0x400679]
Replying to @jdemeyer:
With #12215+#13378 but without #12313:
sage -t -force_lib devel/sage/sage/schemes/elliptic_curves/heegner.py
Ouch. Well, I hope I can reproduce it in Sage-5.6.rc0 debug version.
Fortunately I can confirm it (at least with MALLOCCHECK=3). I'm running it now under gdb.
What I get is:
Program received signal SIGSEGV, Segmentation fault.
0x00007fffedeb9f4c in __pyx_pf_4sage_9structure_11coerce_dict_16TripleDictEraser_2__call__ (__pyx_v_self=0x73982d0, __pyx_v_r=0x7fffea2aaf00) at sage/structure/coerce_dict.c:1107
1107 __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, (__pyx_v_h % PyList_GET_SIZE(__pyx_t_4)));
(gdb) bt
#0 0x00007fffedeb9f4c in __pyx_pf_4sage_9structure_11coerce_dict_16TripleDictEraser_2__call__ (__pyx_v_self=0x73982d0, __pyx_v_r=0x7fffea2aaf00) at sage/structure/coerce_dict.c:1107
#1 0x00007fffedeb9592 in __pyx_pw_4sage_9structure_11coerce_dict_16TripleDictEraser_3__call__ (__pyx_v_self=0x73982d0, __pyx_args=0x75bfd10, __pyx_kwds=0x0) at sage/structure/coerce_dict.c:966
#2 0x00007ffff79be33e in PyObject_Call (func=0x73982d0, arg=0x75bfd10, kw=0x0) at Objects/abstract.c:2529
#3 0x00007ffff79bf059 in PyObject_CallFunctionObjArgs (callable=0x73982d0) at Objects/abstract.c:2760
#4 0x00007ffff7a64194 in handle_callback (ref=0x7fffea2aaf00, callback=0x73982d0) at Objects/weakrefobject.c:881
#5 0x00007ffff7a645e9 in PyObject_ClearWeakRefs (object=0x90c07b0) at Objects/weakrefobject.c:965
#6 0x00007fffee53af5b in __pyx_tp_dealloc_4sage_9structure_15category_object_CategoryObject (o=0x90c07b0) at sage/structure/category_object.c:8990
#7 0x00007fffee7e6fe0 in __pyx_tp_dealloc_4sage_9structure_6parent_Parent (o=0x90c07b0) at sage/structure/parent.c:21519
#8 0x00007fffeea2aa7f in __pyx_tp_dealloc_4sage_9structure_10parent_old_Parent (o=0x90c07b0) at sage/structure/parent_old.c:7261
#9 0x00007fffeec3bca8 in __pyx_tp_dealloc_4sage_9structure_11parent_base_ParentWithBase (o=0x90c07b0) at sage/structure/parent_base.c:1876
#10 0x00007fffead58cbc in __pyx_tp_dealloc_4sage_9structure_11parent_gens_ParentWithGens (o=0x90c07b0) at sage/structure/parent_gens.c:5865
#11 0x00007ffff7a4ce4c in subtype_dealloc (self=0x90c07b0) at Objects/typeobject.c:1014
#12 0x00007ffff7a27be4 in _Py_Dealloc (op=0x90c07b0) at Objects/object.c:2243
#13 0x00007ffff7a480b0 in tupledealloc (op=0x845ab50) at Objects/tupleobject.c:220
#14 0x00007ffff7a27be4 in _Py_Dealloc (op=0x845ab50) at Objects/object.c:2243
#15 0x00007ffff7a480b0 in tupledealloc (op=0x7fffea2a0760) at Objects/tupleobject.c:220
#16 0x00007ffff7a27be4 in _Py_Dealloc (op=0x7fffea2a0760) at Objects/object.c:2243
#17 0x00007ffff7a18e8e in dict_dealloc (mp=0x9052b70) at Objects/dictobject.c:985
#18 0x00007ffff7a27be4 in _Py_Dealloc (op=0x9052b70) at Objects/object.c:2243
#19 0x00007ffff7a4cd73 in subtype_dealloc (self=0x85045a0) at Objects/typeobject.c:999
#20 0x00007ffff7a27be4 in _Py_Dealloc (op=0x85045a0) at Objects/object.c:2243
#21 0x00007fffed102313 in __pyx_tp_dealloc_4sage_10categories_7functor_Functor (o=0x7985950) at sage/categories/functor.c:3209
#22 0x00007fffecee64a1 in __pyx_tp_dealloc_4sage_10categories_6action_Action (o=0x7985950) at sage/categories/action.c:6461
#23 0x00007fffbcd614ea in __pyx_tp_dealloc_4sage_6matrix_6action_MatrixMulAction (o=0x7985950) at sage/matrix/action.c:4724
#24 0x00007ffff7a27be4 in _Py_Dealloc (op=0x7985950) at Objects/object.c:2243
#25 0x00007ffff7a02c8e in list_dealloc (op=0x759fa38) at Objects/listobject.c:309
#26 0x00007ffff7a27be4 in _Py_Dealloc (op=0x759fa38) at Objects/object.c:2243
#27 0x00007ffff7a02c8e in list_dealloc (op=0x7964858) at Objects/listobject.c:309
#28 0x00007ffff7a27be4 in _Py_Dealloc (op=0x7964858) at Objects/object.c:2243
#29 0x00007fffedecec13 in __pyx_tp_clear_4sage_9structure_11coerce_dict_TripleDict (o=0x3cbd8d0) at sage/structure/coerce_dict.c:5921
#30 0x00007ffff7b1378b in delete_garbage (collectable=0x7fffffff30f0, old=0x7ffff7dc1540 <generations+96>) at Modules/gcmodule.c:769
#31 0x00007ffff7b13d04 in collect (generation=2) at Modules/gcmodule.c:930
#32 0x00007ffff7b13f06 in collect_generations () at Modules/gcmodule.c:996
#33 0x00007ffff7b14bcc in _PyObject_GC_Malloc (basicsize=264) at Modules/gcmodule.c:1457
#34 0x00007ffff7b14c04 in _PyObject_GC_New (tp=0x7ffff7d9c5a0 <PyDict_Type>) at Modules/gcmodule.c:1467
#35 0x00007ffff7a16cc7 in PyDict_New () at Objects/dictobject.c:277
#36 0x00007fffeaa83860 in __pyx_f_4sage_4libs_4pari_3gen_12PariInstance_new_ref (__pyx_v_self=0xcceae0, __pyx_v_g=0xa968360, __pyx_v_parent=0xa8d8748) at sage/libs/pari/gen.c:49228
#37 0x00007fffea9fb417 in __pyx_pf_4sage_4libs_4pari_3gen_3gen_80__getitem__ (__pyx_v_self=0xa8d8748, __pyx_v_n=0x61f7f0) at sage/libs/pari/gen.c:8638
#38 0x00007fffea9f63b7 in __pyx_pw_4sage_4libs_4pari_3gen_3gen_81__getitem__ (__pyx_v_self=0xa8d8748, __pyx_v_n=0x61f7f0) at sage/libs/pari/gen.c:7643
#39 0x00007fffeaa9a688 in __pyx_sq_item_4sage_4libs_4pari_3gen_gen (o=0xa8d8748, i=1) at sage/libs/pari/gen.c:55757
#40 0x00007ffff79bcdd7 in PySequence_GetItem (s=0xa8d8748, i=1) at Objects/abstract.c:1989
#41 0x00007ffff7a01934 in iter_iternext (iterator=0xa99c300) at Objects/iterobject.c:58
#42 0x00007ffff7a04abe in listextend (self=0xa7db060, b=0xa8d8748) at Objects/listobject.c:872
#43 0x00007ffff7a08ad9 in list_init (self=0xa7db060, args=0xa7a3920, kw=0x0) at Objects/listobject.c:2458
#44 0x00007ffff7a4c1ad in type_call (type=0x7ffff7d9a3c0 <PyList_Type>, args=0xa7a3920, kwds=0x0) at Objects/typeobject.c:737
#45 0x00007ffff79be33e in PyObject_Call (func=0x7ffff7d9a3c0 <PyList_Type>, arg=0xa7a3920, kw=0x0) at Objects/abstract.c:2529
#46 0x00007fffea9eb6f1 in __pyx_pf_4sage_4libs_4pari_3gen_3gen_12list (__pyx_v_self=0xa8d87d0) at sage/libs/pari/gen.c:4507
#47 0x00007fffea9eb4a0 in __pyx_pw_4sage_4libs_4pari_3gen_3gen_13list (__pyx_v_self=0xa8d87d0, unused=0x0) at sage/libs/pari/gen.c:4455
#48 0x00007ffff7a21156 in PyCFunction_Call (func=0xa85b858, arg=0x7ffff7f90060, kw=0x0) at Objects/methodobject.c:90
#49 0x00007ffff79be33e in PyObject_Call (func=0xa85b858, arg=0x7ffff7f90060, kw=0x0) at Objects/abstract.c:2529
#50 0x00007fffe14ff0aa in __pyx_pf_4sage_5rings_10polynomial_25polynomial_rational_flint_25Polynomial_rational_flint_6__init__ (__pyx_v_self=0xa781258, __pyx_v_parent=0x135f730, __pyx_v_x=0xa8d87d0,
__pyx_v_check=0x7ffff7d89ec0 <_Py_TrueStruct>, __pyx_v_is_gen=0x7ffff7d89e80 <_Py_ZeroStruct>, __pyx_v_construct=0x7ffff7d89e80 <_Py_ZeroStruct>)
at sage/rings/polynomial/polynomial_rational_flint.cpp:5760
#51 0x00007fffe14fc966 in __pyx_pw_4sage_5rings_10polynomial_25polynomial_rational_flint_25Polynomial_rational_flint_7__init__ (__pyx_v_self=0xa781258, __pyx_args=0xa6f97d0, __pyx_kwds=0xa83c050)
at sage/rings/polynomial/polynomial_rational_flint.cpp:5165
#52 0x00007ffff7a4c1ad in type_call (type=0x7fffe174bc20 <__pyx_type_4sage_5rings_10polynomial_25polynomial_rational_flint_Polynomial_rational_flint>, args=0xa6f97d0, kwds=0xa83c050)
at Objects/typeobject.c:737
#53 0x00007ffff79be33e in PyObject_Call (func=0x7fffe174bc20 <__pyx_type_4sage_5rings_10polynomial_25polynomial_rational_flint_Polynomial_rational_flint>, arg=0xa6f97d0, kw=0xa83c050)
at Objects/abstract.c:2529
#54 0x00007ffff7ac8282 in ext_do_call (func=0x7fffe174bc20 <__pyx_type_4sage_5rings_10polynomial_25polynomial_rational_flint_Polynomial_rational_flint>, pp_stack=0x7fffffff3a98, flags=2, na=4, nk=1)
at Python/ceval.c:4334
#55 0x00007ffff7ac1a8b in PyEval_EvalFrameEx (f=0xa663520, throwflag=0) at Python/ceval.c:2705
#56 0x00007ffff7ac420b in PyEval_EvalCodeEx (co=0x7fffe303bb40, globals=0x10a78b0, locals=0x0, args=0xa8acf10, argcount=2, kws=0x0, kwcount=0, defs=0x7fffe17556e8, defcount=4, closure=0x0)
at Python/ceval.c:3253
#57 0x00007ffff79fd447 in function_call (func=0x7fffdfc76ae0, arg=0xa8acee8, kw=0x0) at Objects/funcobject.c:526
#58 0x00007ffff79be33e in PyObject_Call (func=0x7fffdfc76ae0, arg=0xa8acee8, kw=0x0) at Objects/abstract.c:2529
#59 0x00007ffff79da359 in instancemethod_call (func=0x7fffdfc76ae0, arg=0xa8acee8, kw=0x0) at Objects/classobject.c:2578
#60 0x00007ffff79be33e in PyObject_Call (func=0x7ffff0cdf060, arg=0x7fffea521990, kw=0x0) at Objects/abstract.c:2529
#61 0x00007fffe6888d3b in __pyx_f_4sage_9structure_11coerce_maps_24DefaultConvertMap_unique__call_ (__pyx_v_self=0x7fffbcf7f3f0, __pyx_v_x=0xa8d87d0, __pyx_skip_dispatch=0)
at sage/structure/coerce_maps.c:3485
#62 0x00007fffee7acda1 in __pyx_pf_4sage_9structure_6parent_6Parent_28__call__ (__pyx_v_self=0x135f730, __pyx_v_x=0xa8d87d0, __pyx_v_args=0x7ffff7f90060, __pyx_v_kwds=0xa751480)
at sage/structure/parent.c:7415
#63 0x00007fffee7ac0a4 in __pyx_pw_4sage_9structure_6parent_6Parent_29__call__ (__pyx_v_self=0x135f730, __pyx_args=0xa80fc30, __pyx_kwds=0x0) at sage/structure/parent.c:7096
#64 0x00007ffff79be33e in PyObject_Call (func=0x135f730, arg=0xa80fc30, kw=0x0) at Objects/abstract.c:2529
#65 0x00007fffddd720a3 in __pyx_pf_4sage_5rings_12number_field_20number_field_element_18NumberFieldElement_2__init__ (__pyx_v_self=0xa860400, __pyx_v_parent=0x331b730, __pyx_v_f=0xa8d87d0)
at sage/rings/number_field/number_field_element.cpp:6090
#66 0x00007fffddd6d545 in __pyx_pw_4sage_5rings_12number_field_20number_field_element_18NumberFieldElement_3__init__ (__pyx_v_self=0xa860400, __pyx_args=0xa85eab0, __pyx_kwds=0x0)
at sage/rings/number_field/number_field_element.cpp:5340
#67 0x00007ffff7a595f6 in wrap_init (self=0xa860400, args=0xa85eab0,
wrapped=0x7fffddd6d316 <__pyx_pw_4sage_5rings_12number_field_20number_field_element_18NumberFieldElement_3__init__(PyObject*, PyObject*, PyObject*)>, kwds=0x0) at Objects/typeobject.c:4719
#68 0x00007ffff79e2145 in wrapper_call (wp=0xa99c220, args=0xa85eab0, kwds=0x0) at Objects/descrobject.c:998
#69 0x00007ffff79be33e in PyObject_Call (func=0xa99c220, arg=0xa85eab0, kw=0x0) at Objects/abstract.c:2529
#70 0x00007ffff7ac6404 in PyEval_CallObjectWithKeywords (func=0xa99c220, arg=0xa85eab0, kw=0x0) at Python/ceval.c:3890
#71 0x00007ffff79e1194 in wrapperdescr_call (descr=0x7fffde6d9ae0, args=0xa85eab0, kwds=0x0) at Objects/descrobject.c:306
#72 0x00007ffff79be33e in PyObject_Call (func=0x7fffde6d9ae0, arg=0xa881360, kw=0x0) at Objects/abstract.c:2529
#73 0x00007fffddaddacf in __pyx_pf_4sage_5rings_12number_field_30number_field_element_quadratic_28NumberFieldElement_quadratic___init__ (__pyx_v_self=0xa860400, __pyx_v_parent=0x331b730,
__pyx_v_f=0xa8d87d0) at sage/rings/number_field/number_field_element_quadratic.cpp:3893
#74 0x00007fffddadbbdb in __pyx_pw_4sage_5rings_12number_field_30number_field_element_quadratic_28NumberFieldElement_quadratic_1__init__ (__pyx_v_self=0xa860400, __pyx_args=0xa85ca38, __pyx_kwds=0x0)
at sage/rings/number_field/number_field_element_quadratic.cpp:3386
#75 0x00007ffff7a4c1ad in type_call (type=0x7fffddd15020 <__pyx_type_4sage_5rings_12number_field_30number_field_element_quadratic_NumberFieldElement_quadratic>, args=0xa85ca38, kwds=0x0)
at Objects/typeobject.c:737
#76 0x00007ffff79be33e in PyObject_Call (func=0x7fffddd15020 <__pyx_type_4sage_5rings_12number_field_30number_field_element_quadratic_NumberFieldElement_quadratic>, arg=0xa85ca38, kw=0x0)
at Objects/abstract.c:2529
#77 0x00007ffff7ac7bc3 in do_call (func=0x7fffddd15020 <__pyx_type_4sage_5rings_12number_field_30number_field_element_quadratic_NumberFieldElement_quadratic>, pp_stack=0x7fffffff4a10, na=2, nk=0)
at Python/ceval.c:4239
#78 0x00007ffff7ac6efc in call_function (pp_stack=0x7fffffff4a10, oparg=2) at Python/ceval.c:4044
#79 0x00007ffff7ac17f9 in PyEval_EvalFrameEx (f=0x33b1e00, throwflag=0) at Python/ceval.c:2666
#80 0x00007ffff7ac71f4 in fast_function (func=0x7fffddd47450, pp_stack=0x7fffffff4d90, n=2, na=2, nk=0) at Python/ceval.c:4107
#81 0x00007ffff7ac6ee0 in call_function (pp_stack=0x7fffffff4d90, oparg=1) at Python/ceval.c:4042
#82 0x00007ffff7ac17f9 in PyEval_EvalFrameEx (f=0x37a3270, throwflag=0) at Python/ceval.c:2666
#83 0x00007ffff7ac420b in PyEval_EvalCodeEx (co=0x7fffde989ca0, globals=0x1108b20, locals=0x0, args=0xa850f10, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#84 0x00007ffff79fd447 in function_call (func=0x7fffddd43108, arg=0xa850ee8, kw=0x0) at Objects/funcobject.c:526
#85 0x00007ffff79be33e in PyObject_Call (func=0x7fffddd43108, arg=0xa850ee8, kw=0x0) at Objects/abstract.c:2529
#86 0x00007ffff79da359 in instancemethod_call (func=0x7fffddd43108, arg=0xa850ee8, kw=0x0) at Objects/classobject.c:2578
#87 0x00007ffff79be33e in PyObject_Call (func=0x7fffc2ecc360, arg=0xa70d1b0, kw=0x0) at Objects/abstract.c:2529
#88 0x00007fffe6888d3b in __pyx_f_4sage_9structure_11coerce_maps_24DefaultConvertMap_unique__call_ (__pyx_v_self=0x7fffbcd4b780, __pyx_v_x=0xa8d87d0, __pyx_skip_dispatch=0)
at sage/structure/coerce_maps.c:3485
#89 0x00007fffee7acda1 in __pyx_pf_4sage_9structure_6parent_6Parent_28__call__ (__pyx_v_self=0x331b730, __pyx_v_x=0xa8d87d0, __pyx_v_args=0x7ffff7f90060, __pyx_v_kwds=0xa9d32c0)
at sage/structure/parent.c:7415
#90 0x00007fffee7ac0a4 in __pyx_pw_4sage_9structure_6parent_6Parent_29__call__ (__pyx_v_self=0x331b730, __pyx_args=0xa7a3a70, __pyx_kwds=0x0) at sage/structure/parent.c:7096
#91 0x00007ffff79be33e in PyObject_Call (func=0x331b730, arg=0xa7a3a70, kw=0x0) at Objects/abstract.c:2529
#92 0x00007ffff7ac6404 in PyEval_CallObjectWithKeywords (func=0x331b730, arg=0xa7a3a70, kw=0x0) at Python/ceval.c:3890
#93 0x00007ffff7ab2344 in builtin_map (self=0x0, args=0xa8dde70) at Python/bltinmodule.c:1038
#94 0x00007ffff7a210f2 in PyCFunction_Call (func=0x7ffff7f52060, arg=0xa8dde70, kw=0x0) at Objects/methodobject.c:81
#95 0x00007ffff7ac6cdc in call_function (pp_stack=0x7fffffff5900, oparg=2) at Python/ceval.c:4021
#96 0x00007ffff7ac17f9 in PyEval_EvalFrameEx (f=0x3944d10, throwflag=0) at Python/ceval.c:2666
...
I see a couple of familiar names in the backtrace...
Crash log
Attachment: sage_crash_WgD9iG.log
Thanks to Volker's enhanced backtraces, running the test in verbose mode and without gdb yields this backtrace, and the crash occurs here (line 6467 of heegner.py)
sage: E = EllipticCurve('681b')
sage: I = E.heegner_index(-8); I
Unfortunately, running this in an interactive session works just fine.
Got it, I think.
The crash happens in the last line of the following snippet
__pyx_t_1 = __pyx_v_self->D->buckets;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_v_self->D->buckets;
__Pyx_INCREF(__pyx_t_4);
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, (__pyx_v_h % PyList_GET_SIZE(__pyx_t_4)));
and according to the crash log, we have
__pyx_t_1 = 0x7f3db87dcb00 <_Py_NoneStruct>
Hence, again, we have the problem that some attributes have already become invalid. I think this was fixed by the second patch from #12313.
Suggestion: In order to keep things modular, the part of the second #12313 patch that applies to TripleDict
shall be moved here, so that #12215 remains independent of #12313. And then, the second patch of #12313 should be replaced by something that only takes care of the new MonoDict
.
Rationale: #12313 has a problem with a time regression, while #12215 should (hopefully) be fine after installing the fix.
Safer callback in TripleDictEraser
Attachment: trac12215_safe_callback.patch.gz
The patch's up, and it fixes the crash in heegner.py (tested in sage-5.6.rc0 debug version with MALLOCCHECK=3)
Apply trac12215_weak_cached_function_combined.patch trac12215_safe_callback.patch
Description changed:
---
+++
@@ -23,5 +23,6 @@
__Apply__
-[attachment: trac12215_weak_cached_function_combined.patch](https://github.com/sagemath/sage-prod/files/10654390/trac12215_weak_cached_function_combined.patch.gz)
+* [attachment: trac12215_weak_cached_function_combined.patch](https://github.com/sagemath/sage-prod/files/10654390/trac12215_weak_cached_function_combined.patch.gz)
+* [attachment: trac12215_safe_callback.patch](https://github.com/sagemath/sage-prod/files/10654392/trac12215_safe_callback.patch.gz)
Yes, this solves the problem here as well, so positive review.
It looks like the analysis on #12313:226 and the patch that followed from it was based on this ticket. I probably pulled the non-raw patches for #12313 when I tested ... Should we factor out a utility from the Patchbot to pull and apply patches given a ticket number?
Happy to see this work did find some use after all. Again, I believe that in the future, when TripleDictEraser
holds a weakref to its dictionary, this won't be necessary anymore, because the weakref will be broken before attributes on the dictionary get erased.
That enhanced traceback (including cython code!) is extremely cool. A big thanks to Volker for making that happen. With that traceback, you only only have to stare at the traceback to diagnose this problem.
Just for the record: All tests pass on my openSuse
laptop in the debug version of sage-5.6.rc0+#13878+#13378+#12215, with MALLOCCHECK=3.
Merged: sage-5.7.beta1
The documentation says that UniqueRepresentation uses weak refs, but this was switched over to the
@
cached_method decorator. The latter does currently use strong references, so unused unique parents stay in memory forever:Related tickets:
11521 (needs review, introducing weak references for caching homsets), and
715 (needs review, using weak references for caching coerce maps).
5970 (the polynomial rings cache use strong references, which may now be a duplicate, as I introduce the weak cache in #715)
Further notes:
None
cannot.Apply
CC: @simon-king-jena @jdemeyer @mwhansen @vbraun @jpflori
Component: memleak
Keywords: UniqueRepresentation cached_method caching
Author: Simon King
Reviewer: Nils Bruin
Merged: sage-5.7.beta1
Issue created by migration from https://trac.sagemath.org/ticket/12215