refresh-bio / agc

Assembled Genomes Compressor
MIT License
152 stars 13 forks source link

Fix segmentation fault in agc create caused by empty input files #10

Closed tmaklin closed 5 months ago

tmaklin commented 8 months ago

Hi, I ran into a segmentation fault in "agc create" that was caused by empty gzip archives being included in the input files.

This pull request fixes the segfault by adding a check to CAGCCompressor::AddSampleFiles for whether the input file being read with gio.ReadContigRaw actually returned any contigs. If no contigs were returned the file is ignored and the program prints out the message Warning: Pair sample_name:file_path " << sf.first << ":" << sf.second << " contains no contigs and will not be included in the archive! to inform the user that this file won't be in the archive.

Thanks for creating agc, it's very impressive and useful.

sebastiandeorowicz commented 6 months ago

Thank you. I'll integrate this in the forthcoming v.3.1 release.

sebastiandeorowicz commented 5 months ago

AGC 3.1 with the fix is ready. Thank you.