GATB / leon

Leon - FASTA and FASTQ read compressor
https://gatb.inria.fr/software/leon
GNU Affero General Public License v3.0
8 stars 4 forks source link

Segfault in FASTA Compression with Sequence Length < k-mer Length #5

Closed kreuvf closed 6 years ago

kreuvf commented 6 years ago

Version: e7f6ad2fecc060883cef29f0bd5c117fd3abe5ae OS: Ubuntu 16.04, 64 Bit

Trying to compress a FASTA file results in a segfault. Same behaviour with debug build.

Crash occurs in DnaEncoder::smoothQuals(). The problem appears to lie in the read length. If the read length is less than the k-mer length of 31 (?), the crash occurs.

I generated a pair of FASTA files for you. One file is working, the other contains one character less and makes leon crash.

leon_fine.fasta.gz leon_crash.fasta.gz

I have an Apport crash report of running a debug build and could give you the core dump as well. On the other hand, I am pretty sure that this can be reproduced easily.

rizkg commented 6 years ago

Thank you for your analysis of this bug. It is now fixed in commit ee90b92d26465c558914c69b97c9d0a91b3d30e6

kreuvf commented 6 years ago

Thank you for the quick response, but it seems the problem persists.

$ git log -n1
commit ee90b92d26465c558914c69b97c9d0a91b3d30e6
Author: Guillaume Rizk <guillaume.rizk@gmail.com>
Date:   2018-01-21 13:30:44 +0100

    update gatb-core version
$ git submodule status
 e24598448646708d8a3eb0c7c3508fbab2da812d thirdparty/gatb-core (v1.4.1-8-ge245984)
$ ./leon -version
* * * * * * * * * * * * * * * * * * * * * *
* Leon version 1.1.0                      *
* Using GATB-Core version 1.4.1           *
* * * * * * * * * * * * * * * * * * * * * *

Can you reproduce the issue?

rizkg commented 6 years ago

Oh, my bad, I assumed wrongly it was related to another similar bug that caused fastq files to crash when length < kmer size.

I reproduced your issue, and fixed in commit daecf40febcb1ae789ebbcd5bd94041857a4a5ce

Guillaume

kreuvf commented 6 years ago

Don't worry, I'm glad that it's working now. Thank you very much for fixing this bug in such a short time. :) If only all developers would fix their bugs that fast ^_^