#12215: Memleak in UniqueRepresentation, @cached_method
-----------------------------+----------------------------------------------
Reporter: vbraun | Owner: rlm
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.0
Component: memleak | Keywords: UniqueRepresentation
cached_method caching
Work_issues: Fix two tests | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #11115 #11900
-----------------------------+----------------------------------------------
Comment(by vbraun):
Here is the stack trace:
{{{
#0 0x00007ffaadb88511 in
__pyx_tp_dealloc_4sage_10categories_7functor_Functor (o=0x63ed250) at
sage/categories/functor.c:2845
#1 0x00007ffaad970cc8 in
__pyx_tp_dealloc_4sage_10categories_6action_Action (o=0x63ed250) at
sage/categories/action.c:5943
#2 0x00007ffaad5485a0 in
__pyx_tp_dealloc_4sage_9structure_14coerce_actions_ModuleAction
(o=0x63ed250) at sage/structure/coerce_actions.c:7505
#3 0x00007ffabbcf8f0c in type_call (type=<optimized out>, args=0x63e09e0,
kwds=0x0) at Objects/typeobject.c:748
#4 0x00007ffabbca27a3 in PyObject_Call (func=0x7ffaad754ec0,
arg=<optimized out>, kw=<optimized out>) at Objects/abstract.c:2492
#5 0x00007ffaad53ffbb in
__pyx_pf_4sage_9structure_14coerce_actions_1detect_element_action
(__pyx_self=0x0, __pyx_args=0x63fbb40, __pyx_kwds=0x0)
at sage/structure/coerce_actions.c:4616
#6 0x00007ffabbca27a3 in PyObject_Call (func=0x2683dd0, arg=<optimized
out>, kw=<optimized out>) at Objects/abstract.c:2492
#7 0x00007ffaaeb0ea32 in
__pyx_f_4sage_9structure_6parent_6Parent_discover_action
(__pyx_v_self=0x644ab00, __pyx_v_S=0x6448770,
__pyx_v_op=0x7ffab525aea8, __pyx_v_self_on_left=1) at
sage/structure/parent.c:16618
#8 0x00007ffaaed48057 in
__pyx_f_4sage_9structure_10parent_old_6Parent_get_action_c_impl
(__pyx_v_self=0x644ab00, __pyx_v_S=0x6448770,
__pyx_v_op=0x7ffab525aea8, __pyx_v_self_on_left=1) at
sage/structure/parent_old.c:3312
#9 0x00007ffaaed47ea2 in
__pyx_pf_4sage_9structure_10parent_old_6Parent_4get_action_impl
(__pyx_v_self=0x644ab00, __pyx_args=0x63fb910,
__pyx_kwds=0x0) at sage/structure/parent_old.c:3258
#10 0x00007ffabbca27a3 in PyObject_Call (func=0x636a5a8, arg=<optimized
out>, kw=<optimized out>) at Objects/abstract.c:2492
#11 0x00007ffaaed46ee7 in
__pyx_f_4sage_9structure_10parent_old_6Parent_get_action_c
(__pyx_v_self=0x644ab00, __pyx_v_S=0x6448770,
__pyx_v_op=0x7ffab525aea8, __pyx_v_self_on_left=1,
__pyx_skip_dispatch=0) at sage/structure/parent_old.c:2935
#12 0x00007ffaaed4f19d in
__pyx_f_4sage_9structure_10parent_old_6Parent__get_action_
(__pyx_v_self=0x644ab00, __pyx_v_other=0x6448770,
__pyx_v_op=0x7ffab525aea8, __pyx_v_self_on_left=1,
__pyx_skip_dispatch=0) at sage/structure/parent_old.c:6228
#13 0x00007ffaaeb0b17c in
__pyx_f_4sage_9structure_6parent_6Parent_get_action
(__pyx_v_self=0x644ab00, __pyx_v_S=0x6448770, __pyx_skip_dispatch=0,
__pyx_optional_args=0x7fff38b8e2f0) at sage/structure/parent.c:15635
#14 0x00007ffaae1fa2e6 in
__pyx_f_4sage_9structure_6coerce_24CoercionModel_cache_maps_discover_action
(__pyx_v_self=0x26286d0, __pyx_v_R=0x644ab00,
__pyx_v_S=0x6448770, __pyx_v_op=0x7ffab525aea8, __pyx_skip_dispatch=0)
at sage/structure/coerce.c:12473
#15 0x00007ffaae1f6564 in
__pyx_f_4sage_9structure_6coerce_24CoercionModel_cache_maps_get_action
(__pyx_v_self=0x26286d0, __pyx_v_R=0x644ab00,
__pyx_v_S=0x6448770, __pyx_v_op=0x7ffab525aea8, __pyx_skip_dispatch=0)
at sage/structure/coerce.c:11424
#16 0x00007ffaae1e64e2 in
__pyx_f_4sage_9structure_6coerce_24CoercionModel_cache_maps_bin_op
(__pyx_v_self=0x26286d0, __pyx_v_x=0x6354b48,
__pyx_v_y=0x63e36b0, __pyx_v_op=0x7ffab525aea8, __pyx_skip_dispatch=0)
at sage/structure/coerce.c:6583
#17 0x00007ffaae448f03 in
__pyx_pf_4sage_9structure_7element_6Vector_1__mul__
(__pyx_v_left=0x6354b48, __pyx_v_right=0x63e36b0)
at sage/structure/element.c:16130
#18 0x00007ffabbc9dc5f in binary_op1 (v=0x6354b48, w=0x63e36b0,
op_slot=16) at Objects/abstract.c:917
#19 0x00007ffabbca0cc8 in PyNumber_Multiply (v=0x6354b48, w=0x63e36b0) at
Objects/abstract.c:1188
#20 0x00007ffa9be33b68 in
__pyx_f_4sage_5rings_13residue_field_12ReductionMap__call_
(__pyx_v_self=0x63f10e8, __pyx_v_x=0x6405108,
__pyx_skip_dispatch=0) at sage/rings/residue_field.c:8140
}}}
within `coercion_model.bin_op()` (frame 17) there are calls to Python
methods (`PyObject_Call`), and in there the garbage collector is free to
run. I suspect that this is what is happening somewhere...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12215#comment:66>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.