forked from samtools/htslib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More protection against running out of memory (all formats read side).
These have been found by using a malloc replacement (added to the Makefile plus header include using CFLAGS="-g -include malloc_fuzz.h") so that the Nth memory allocation will always fail. We then loop from 1 upwards until we succeed, checking every place for a proper handling of the error. Eg: for i in `seq 1 20000` do echo $i FUZZ=$i ./test/test_view -@4 -B in.bam 2>&1 test "$?" ">" 1 && break done Changes include - bgzf MT reading now sets mt->command = CLOSE and has additional calls to shutdown the queue on memory errors. This is checked for in bgzf_check_EOF to avoid deadlock. - bgzf now has a pool_create() error check. - Distinguish between errors vs would-block in cram_decode_slice_mt - Make cram_drain_rqueue cope with failed jobs. - Improve cram_close to cope with shuting down after failed initialisation, such as rqueue not being initialised. - Check for realloc failure in refs_load_fai. - Fix segfault in cram_decode_slice if cram_get_ref failed. - Removed abort in load_hfile_plugins. It now returns -1 and is checked for in find_scheme_handler. - Documented return values in hts_getline - Attempt to propagate memory error in kgetline2 to file pointer, but this only works for hgets (not gets). Fundamentally this is unsolvable with the current API. - Fixed memory tear-down in sam_parse_worker so it doesn't claim to have allocated more than it managed. - sam_set_thread_pool now copes with failure to create the queue. - Tabix index_load now checks calloc return. - Extra allocation return checks in hts_tpool_process_init and hts_tpool_init. - Check ksprintf worked in vcf fix_chromosome. Co-Authored-By: Rob Davies <[email protected]>
- Loading branch information
1 parent
773b6ed
commit 8ae25df
Showing
10 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters