Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault in lcp for the terminal symbol alone #3

Open
hynekcer opened this issue Jan 19, 2015 · 1 comment
Open

Segmentation fault in lcp for the terminal symbol alone #3

hynekcer opened this issue Jan 19, 2015 · 1 comment

Comments

@hynekcer
Copy link
Contributor

I'm testing the package on random data:

>>> sequence = '$'
>>> sa = pysais.sais(sequence)
>>> lcp, lcp_lm, lcp_mr = pysais.lcp(sequence, sa)
Segmentation fault (core dumped)

(I observed segmentation faults also on normal data sometimes if I omitted the terminal symbol. But I understand that you strictly require it.)

@AlexeyG
Copy link
Owner

AlexeyG commented Feb 22, 2015

The corner case of sequence = '$' should be easily fixable with an if statement. Same goes for checking the presence of the terminal symbol. But the way I see it, these checks of input data just eat up CPU cycles. And the only reason why I'm using the SAIS C module is to gain the speed that would be unattainable with a pure python implementation.

You're very welcome to add the checks and I'll merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants