You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is likely an obscure corner case that is hard to protect against, but may be useful. I'm not sure if it is the responsibility of odgi to gracefully tell people their graphs are malformed rather than crashing, but there is at least a partial issue here.
Running odgi validate on a gfa where the path includes a non-existant node causes a segfault.
S 1 A
S 2 C
S 3 T
S 4 G
L 1 + 2 + 0M
L 1 + 3 + 0M
L 2 + 4 + 0M
P foo 1+,2+,4+ 0M
P bar 1+,5+ 0M
Arguably, the description of the subcommand should tell the user the paths are not consistent with the graph (since no path can contain node 5 since node 5 doesn't exist). This currently only checks for consistency with L-lines assuming L-lines are already consistent with S-lines.
Interestingly, a gfa with a link line containing a non-existant node raises a "Floating point exception"
S 1 A
S 2 C
S 3 T
S 4 G
L 1 + 2 + 0M
L 1 + 3 + 0M
L 2 + 4 + 0M
L 2 + 5 + 0M
P foo 1+,2+,4+ 0M
P bar 1+,3+ 0M
This can be guarded against with some checks in src/gfa_to_handle.cpp, namely for edges here
This is likely an obscure corner case that is hard to protect against, but may be useful. I'm not sure if it is the responsibility of
odgi
to gracefully tell people their graphs are malformed rather than crashing, but there is at least a partial issue here.Running
odgi validate
on a gfa where the path includes a non-existant node causes a segfault.Arguably, the description of the subcommand should tell the user the paths are not consistent with the graph (since no path can contain node 5 since node 5 doesn't exist). This currently only checks for consistency with L-lines assuming L-lines are already consistent with S-lines.
Interestingly, a gfa with a link line containing a non-existant node raises a "Floating point exception"
This can be guarded against with some checks in src/gfa_to_handle.cpp, namely for edges here
odgi/src/gfa_to_handle.cpp
Lines 89 to 91 in 2151dd8
and presumably for paths here
odgi/src/gfa_to_handle.cpp
Lines 127 to 129 in 2151dd8
Unsurprisingly since the issue originates in the gfa loading, almost all subcommands segfault if the path contains a non-existant node.
Best,
Alex
The text was updated successfully, but these errors were encountered: