#9863: Error in sage/graphs/genus.pyx on ia64-Linux-suse
-----------------------+----------------------------------------------------
   Reporter:  mpatel   |       Owner:  mvngu   
       Type:  defect   |      Status:  new     
   Priority:  blocker  |   Milestone:  sage-4.6
  Component:  doctest  |    Keywords:          
     Author:           |    Upstream:  N/A     
   Reviewer:           |      Merged:          
Work_issues:           |  
-----------------------+----------------------------------------------------
Changes (by mderickx):

 * cc: mderickx (added)


Comment:

 I know that python uses a garbage collector, I don't really know the
 detailed workings of the garbage collector, neither do I know all the
 internals of the implementation of the graphs code used here. But I do
 know that from first sight there might be a possibility that the garbage
 collector might collect some garbagage created by the second assignment to
 G in between the two "get_memory_usage" statements.

 There is an easy way to rule out this possibilty by changing the test code
 to:
 {{{
 sage: import sage.graphs.genus
 sage: G = graphs.CompleteGraph(100)
 sage: H = Graph(G, implementation='c_graph', sparse=False)
 sage: t = get_memory_usage()
 sage: gb =
 sage.graphs.genus.simple_connected_genus_backtracker(H._backend._cg)
 sage: gb = None  #indirect doctest
 sage: get_memory_usage(t)
 0.0
 }}}
 In this way, you don't overwrite the reference to
 graphs.CompleteGraph(100) so there is no possibility of accidental garbage
 collection.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9863#comment:5>
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.

Reply via email to