Opened 5 years ago

Last modified 5 years ago

#17376 closed defect

Cleanup subgraphsearch to avoid crashes — at Initial Version

Reported by: ncohen Owned by:
Priority: major Milestone: sage-6.5
Component: graph theory Keywords:
Cc: dcoudert, dimpase, jmantysalo, vdelecroix, Simon, tscrim Merged in:
Authors: Nathann Cohen Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

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?.

Change History (0)

Note: See TracTickets for help on using tickets.