remove extraenous OOB write#2163
Open
eternal-flame-AD wants to merge 1 commit intoalexdobin:masterfrom
Open
Conversation
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
birdingman0626
added a commit
to birdingman0626/STAR-Win
that referenced
this pull request
Apr 13, 2026
Bug fixes from upstream STAR PRs: - PR alexdobin#2163: Remove OOB write in sjdbInsertJunctions.cpp (SA.writePacked at index nSA is one past the end; memory corruption confirmed by Valgrind) - PR alexdobin#2676: Fix memory leaks in outputSJ.cpp (sjA, sjFilter, sjChunks arrays allocated but never freed) - PR alexdobin#535: Fix segfault in SA lookup shortcut in ReadAlign_maxMappableLength2strands.cpp (unreliable shortcut caused unsigned underflow and SIGSEGV on certain genomes) Performance optimizations: - PR alexdobin#791: PackedArray bitmask optimization (replace expensive double-shift with single AND in hot operator[]; ~1-2% improvement) - PR alexdobin#791: Add FastResetVector.h (O(modified) reset instead of O(N) memset; available for winBin array optimization) - PR alexdobin#773 (partial): Early rejection in stitchWindowAligns.cpp to skip unnecessary Transcript copies when alignment will obviously fail HTSlib upgrade evaluated and deferred: current 1.3 has minimal security surface (no CRAM, no network I/O, trusted input only). Note: uniquely mapped count changes slightly due to PR alexdobin#535 fix — the buggy shortcut was incorrectly skipping valid alignments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
I verified this fixes #2158
Not sure why this was added in the first place, with the line removed I could not reproduce a complaining valgrind with the nf-core/rnaseq test dataset or the dataset referenced in #2158 or my own dataset. However this line seem to produce a guaranteed OOB write:
STAR/source/Genome_genomeGenerate.cpp
Line 298 in b1edc12
From this line it seems the buffer for
SAis only isnSAlong thus accessing thenSA-th element will be a guaranteed OOB write. In certain configuration combinations this will overwrite allocation header for something else and cause the crash.