Skip to content

Avoid unaligned packed index accesses#2697

Open
justinblethrow-cloud wants to merge 1 commit into
alexdobin:masterfrom
justinblethrow-cloud:fix-unaligned-packed-index-access
Open

Avoid unaligned packed index accesses#2697
justinblethrow-cloud wants to merge 1 commit into
alexdobin:masterfrom
justinblethrow-cloud:fix-unaligned-packed-index-access

Conversation

@justinblethrow-cloud

Copy link
Copy Markdown

Summary

  • Replace unaligned typed loads and stores in PackedArray with fixed-size memcpy operations.
  • Apply the same treatment to packed suffix loads used during genome generation and suffix-array search.
  • Add an odd-address ASan/UBSan regression test.

Problem

STAR intentionally packs arrays at byte-granular offsets, but several accessors cast those addresses to uint64_t* or uint128* and dereference them. These operations are undefined on unaligned addresses and are reported during both index generation and mapping by UBSan.

Validation

  • extras/tests/scripts/testPackedArray.sh passes; its odd-address case reports a misaligned access against unmodified 2.7.11b.
  • A full ASan/UBSan build succeeds.
  • Tiny annotated genomeGenerate completes with UBSAN_OPTIONS=halt_on_error=1.
  • Fourteen core genome and annotation artifacts, including Genome, SA, SAindex, chromosome metadata, gene/transcript/exon tables, and SJDB files, are byte-identical to unmodified 2.7.11b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant