#17376: Cleanup subgraphsearch to avoid crashes
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: needs_review
Type: | Milestone: sage-6.5
defect | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
graphics | Work issues:
Keywords: | Commit:
Authors: | de40d01a7a79dc7c30700e48bd9545eb0d528ebd
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
u/ncohen/17376 |
Dependencies: |
-------------------------+-------------------------------------------------
Description changed by ncohen:
Old description:
> 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.
New description:
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#comment:4>
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.