Fix splitsequence soft-link mode crash with profile DBs#7
Open
antonvnv wants to merge 1 commit into
Open
Conversation
splitsequence --sequence-split-mode 1 (soft-link) wrote position-based
offsets directly as byte offsets into the index. This is correct for
sequence DBs (1 byte per position) but wrong for profile DBs where each
position occupies PROFILE_READIN_SIZE (27) bytes.
When blastdigp.sh runs iterative search on a long query (>10000nt),
extractqueryprofiles produces a dinucleotide profile and splitsequence
splits it in soft-link mode. The resulting index entries pointed to
misaligned byte offsets (e.g. byte 10000 instead of 10000*27=270000),
causing ungappedprefilter to read garbage profile data and segfault in
Sequence::mapProfile.
The bug was latent because the conditions rarely coincided:
- Target DBs use hard-copy mode (--sequence-split-mode 0), unaffected
- Query profiles only get split when the query exceeds maxSeqLen
- Only the pskvins nucleotide pipeline creates profile DBs that pass
through splitsequence soft-link mode
Fix: multiply startPos and len by PROFILE_READIN_SIZE when writing
soft-link index entries for profile DBs.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
splitsequence --sequence-split-mode 1 (soft-link) wrote position-based offsets directly as byte offsets into the index. This is correct for sequence DBs (1 byte per position) but wrong for profile DBs where each position occupies PROFILE_READIN_SIZE (27) bytes.
When blastdigp.sh runs iterative search on a long query (>10000nt), extractqueryprofiles produces a dinucleotide profile and splitsequence splits it in soft-link mode. The resulting index entries pointed to misaligned byte offsets (e.g. byte 10000 instead of 10000*27=270000), causing ungappedprefilter to read garbage profile data and segfault in Sequence::mapProfile.
The bug was latent because the conditions rarely coincided:
Fix: multiply startPos and len by PROFILE_READIN_SIZE when writing soft-link index entries for profile DBs.