benedictpaten / pinchesAndCacti

Library for constructing pinch graphs and cactus graphs
MIT License
10 stars 4 forks source link

Segfaults on Single Edge Graphs #8

Open adamnovak opened 6 years ago

adamnovak commented 6 years ago

Trying to find the snarls on a graph with a single node in vg (which translates to a single Cactus edge), or with single-node connected components, is causing segfaults in pinchesAndCacti. They look like this:

(gdb) bt
#0  stSet_getNext (iterator=iterator@entry=0x1) at impl/sonLibSet.c:90
#1  0x0000000000ce2a9e in getBridgePathConnectingEnds (bridgeGraph=bridgeGraph@entry=0x1ba8380, 
    startEdgeEnd=startEdgeEnd@entry=0x1ddf320, endEdgeEnd=endEdgeEnd@entry=0x1ddf350) at impl/stCactusGraphs.c:1222
#2  0x0000000000ce2e9e in stCactusGraph_getTopLevelSnarlChain (cactusGraph=cactusGraph@entry=0x1d65e60, 
    startEdgeEnd=startEdgeEnd@entry=0x1ddf320, endEdgeEnd=0x1ddf350, snarlCache=snarlCache@entry=0x1ba8138)
    at impl/stCactusGraphs.c:1408
#3  0x0000000000ce31a3 in stCactusGraph_getSnarlDecomposition (cactusGraph=0x1d65e60, snarlChainEnds=0x1e0a520)
    at impl/stCactusGraphs.c:1544
#4  0x00000000008ebbcc in vg::CactusSnarlFinder::find_snarls (this=0x1dc3540) at src/genotypekit.cpp:355

I can try and turn this into a test, but do we expect a single-node component (with the telomeres being opposite ends of the node) to work?