smithlabcode / falco

A C++ drop-in replacement of FastQC to assess the quality of sequence read data
https://falco.readthedocs.io
GNU General Public License v3.0
90 stars 10 forks source link

Segmentation fault (core dumped) for zero length reads #26

Closed y9c closed 2 years ago

y9c commented 2 years ago

After trimming, some reads might be 0 in length. falco can not deal with these reads correctly.

guilhermesena1 commented 2 years ago

I'm so sorry it took this long to reach out but I think I fixed the problem. I'll make a new release in the coming days to address this. Commit 64d98db should not crash on empty reads. Definitely a very important bug to address!

y9c commented 2 years ago

Thanks!

y9c commented 2 years ago

Hi @guilhermesena1,

The new patch create more bugs. When there is a empty read, falco will keep running, but it can not generate any output, and terminate with the following error.

 terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
[1]    3085727 abort (core dumped)  falco ./test.fq.gz -o test
y9c commented 2 years ago

This error is not cause by zero length reads. Any fastq input can cause this error. If html output is skip, everything works fine.


I compile the code with autoreconf command, then it works.

y9c commented 2 years ago

I would like to know why zero length reads is not in the "Sequence Length Distribution" plot? Thanks.

guilhermesena1 commented 2 years ago

hey.

for the first error, I think your call has reversed the parameters. Falco takes multiple FASTQC as inputs, and this requires the file names to be the last parameters in the call, so instead of

falco test.fq.gz -o test

it should be

falco -o test test.fq.gz

I'll look into the plot issue right now.

guilhermesena1 commented 2 years ago

ok the plot issue should be fixed at 0523ad90

y9c commented 2 years ago

Thank you for the update

y9c commented 2 years ago

Hi @guilhermesena1

It seem that falco is still have bugs in dealing short reads. When input reads are too short, the html report can not be generated.

Error message:

terminate called after throwing an instance of 'std::length_error'

test input:

@test
TTACAGCACT
+
FFFFFFFFFF