#17376: Cleanup subgraphsearch to avoid crashes
------------------------+---------------------------------
   Reporter:  ncohen    |            Owner:
       Type:  defect    |           Status:  new
   Priority:  major     |        Milestone:  sage-6.5
  Component:  graphics  |         Keywords:
  Merged in:            |          Authors:  Nathann Cohen
  Reviewers:            |  Report Upstream:  N/A
Work issues:            |           Branch:
     Commit:            |     Dependencies:
   Stopgaps:            |
------------------------+---------------------------------
 The !SubgraphSearch code crashes from time to time when you Ctrl+C it
 during its memory allocation instructions.

 This patch cleans the code a bit so that all allocations happen in one
 place, before the actual code is run. And so `__dealloc__` only frees the
 memory that has been allocated, even if the code was interrupted.

 Basically, we avoid crashed only with simple code cleaning.

 1) In order to produce the crash, run this and CTRL+C it immediately:

 {{{
 
graphs.CompleteMultipartiteGraph([20,20,20,20]).subgraph_search(graphs.CompleteGraph(5))
 }}}

 Do it several times in a row if necessary.

 2) The code could use a rewrite with bitsets. It would be faster and
 lighter in memory, but there is already a pretty similar code in
 `needs_review` at #17309 and I fear that it may take time before it is
 reviewed. So I will wait for this before reimplementing SubgraphSearch.

--
Ticket URL: <http://trac.sagemath.org/ticket/17376>
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to