marcom / ViennaRNA.jl

Julia interface to ViennaRNA for RNA structure prediction and analysis
Other
21 stars 1 forks source link

Segfault for `plot_coords("()")` #13

Closed marcom closed 1 year ago

marcom commented 1 year ago

Segfault:

using ViennaRNA
plot_coords("()")  # sometimes doesn't segfault but keeps on going...
plot_coords(Pairtable("()")) # also segfaults
plot_coords("((()))") # also crashes, but in a different way

These work:

using ViennaRNA
plot_coords("")
plot_coords("(.)")
plot_coords("(..)")
plot_coords("(((.)))")
plot_coords("(((..)))")

It crashes on the line

n = _vrna_plot_coords(structure, ptr_cx, ptr_cy, type)

Which in turn calls

LibRNA.vrna_plot_coords(structure, cx, cy, type)

Tests for different plot_type

Works

plot_coords("()"; plot_type=:simple)    # type = 0
plot_coords("()"; plot_type=:naview)    # type = 1
plot_coords("()"; plot_type=:circular)    # type = 2

Crashes (sometimes also seems to just hang)

plot_coords("()"; plot_type=:turtle)    # type = 3
plot_coords("()"; plot_type=:puzzler)    # type = 4
marcom commented 1 year ago

Since ViennaRNA.jl v0.10.1, plot_coords will throw an Exception in the above-mentioned cases that caused a segfault. This mitigation can be removed once the issue is fixed upstream.