Skip to content
Snippets Groups Projects
Commit 1c4acb41 authored by James Bonfield's avatar James Bonfield Committed by Rob Davies
Browse files

More general CRAM multi-threading fixes (not related to multi-slice).

These were spotted by gcc -fsanitize=thread.

1. Decoding: fd->no_ref is set while decoding the compression header
and used in subsequent slice decodes, but we may then decode the next
container compression header before the previous slices have finished
decoding.

2. Decoding: avoid race when limiting data via required_fields.

fd->decode_md is now copied to s->decode_md, so the slice can disable
this itself if required (such as when the user asked for MD tag to be
filled out while also asking not to return any auxiliary blocks).

Although technically fixing a threading violation, the practical
implementations means this is just a tidyup rather than any real
behavior changes.

3. Encoding: Cram_encode_aux needed an extra guard surrounding the
fd->tags_used field.  This is used to hold tag types seen so far in
the file, within any container or block, so we can keep track of the
compression methods that work best for a any specific tag type.
parent 18931338
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment