Rerito / Penjing

C++20 Generalized Suffix Tree implementation
MIT License
12 stars 0 forks source link

Segfault on mississippixsissy$ #5

Closed tomsmeding closed 3 years ago

tomsmeding commented 5 years ago

The following code crashes reproducibly with a segmentation fault on my machine:

st::suffix_tree<> t1('$');
t1.emplace("mississippixsissy$");

This happens on the master branch. Since the crash doesn't occur when changing the string slightly, e.g. by removing the 'x', I'm tempted to think it's a bug in the algorithm.

Ukkonen's algorithm is a royal pain to implement, so thanks heaps for making this; I just wanted to let you know.

Rerito commented 5 years ago

Hi Tom,

This is indeed a bug in my implementation. I was able to reproduce it and developed a quick print_tree function to check my suffix trees' layout... Not one is correct...

Thank you for pointing it out!

Rerito commented 3 years ago

After a complete rework, it appears this issue is solved!