#14059: Fix refcount/deallocation of integers
-----------------------------+----------------------------------------------
       Reporter:  SimonKing  |         Owner:  rlm     
           Type:  defect     |        Status:  new     
       Priority:  blocker    |     Milestone:  sage-5.7
      Component:  memleak    |    Resolution:          
       Keywords:             |   Work issues:          
Report Upstream:  N/A        |     Reviewers:          
        Authors:             |     Merged in:          
   Dependencies:             |      Stopgaps:          
-----------------------------+----------------------------------------------

Comment (by jpflori):

 Replying to [comment:18 SimonKing]:
 > Replying to [comment:17 jpflori]:
 > > The problem occurs when deallocating ONE, which is allocated before
 the hooks are setup, with the hooked method.
 >
 > OK. But ONE is not the only integer that gets created before setting the
 hook.
 I agree it is a problem.
 >
 > The created integers are:
 >
 > * 0
 > * 1
 > * ONE (hence, the integer 1 is created, and then another 1 is created
 and assigned to ONE)
 > * -1
 > * 0
 > * 1
 > * `global_dummy_Integer` (which is 0)
 >
 > And them the hooks are established.
 >
 > > Creating ONE after hooking up the method (seemingly) solves the
 problem.
 >
 > But probably we should take care of the other elements as well.
 Yup.
 >
 > By the way: There is another way to make the segfault vanish. We could
 simply insert print statements, that print the memory addresses of the
 integers when they are created/deleted/taken from the pool/put into the
 pool. It works (but don't take it as a serious suggestion...)!
 >
 > So, how did you find out that ONE is deallocated with the hooked method?
 Looking at the enhanced backtrace.
 A dict is deallocated and our tools are smart enough to print the name of
 the object in the dict with there address and one step further the
 fats_tp_dealloc method is called on the address corresponding to ONE.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14059#comment:22>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to