lmdu/pyfastx

Segfault when using full_name=True for Fasta iteration

cmorganl opened this issue · 6 comments

Hi Lianming,

I'm gettting a segfault when the full_name flag is set to True and build_index is set to False for any fasta file. This behaviour is in 0.8.0 and 0.8.1, while 0.7.0 is functioning fine.

Here's an example line:

for name, seq in Fasta(fasta_input, build_index=False, full_name=True):

It segfaults on the next line.

Let me know if you need any more information.

Thanks!
Connor

lmdu commented

Could you send me your code, system information and python environment. I have run pyfastx on Windows, CentOS and Ubuntu, it works fine.

OS: Ubuntu 16.04 and 18.04
Python: 3.7.3

I found it was actually able to parse some fasta files but not all and I have no idea why. I've attached two examples that cause the segfault. I tried a few different methods for parsing these files and it seems like the only factor that matters is the fasta file. You should be able to just use these in some of your existing tests but if not I can provide a function that's been breaking for me.

fasta_parser_test.fasta.txt

PuhA.fa.txt

Thanks!

lmdu commented

Thank you for providing test data! I have made a serious mistake to process full name for sequence without comment. I will quickly fix it in next version.

Glad I could help and thanks for working on it so quickly!

lmdu commented

New version was released to fixed this issue. Thanks again!

Awesome, thanks!