[all-commits] [llvm/llvm-project] 8fd135: [OffloadBundler] Bound compressed bundles by heade...

michaelselehov via All-commits all-commits at lists.llvm.org
Thu Jul 9 03:33:45 PDT 2026


  Branch: refs/heads/users/michaelselehov/offload-ccob-filesize
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fd1355cfc348f447a83da1a33b484a5dc1ddc78
      https://github.com/llvm/llvm-project/commit/8fd1355cfc348f447a83da1a33b484a5dc1ddc78
  Author: mselehov <mselehov at amd.com>
  Date:   2026-07-09 (Thu, 09 Jul 2026)

  Changed paths:
    M clang/lib/Driver/OffloadBundler.cpp
    A clang/test/Driver/Inputs/clang-offload-bundler-magic-collision.co
    A clang/test/Driver/Inputs/clang-offload-bundler-magic-collision.py
    A clang/test/Driver/clang-offload-bundler-magic-collision.c
    M llvm/lib/Object/OffloadBundle.cpp
    A llvm/test/tools/llvm-objdump/Offloading/fatbin-magic-collision.test

  Log Message:
  -----------
  [OffloadBundler] Bound compressed bundles by header size, not magic scan

When multiple offload bundles are concatenated, the unbundler
(clang-offload-bundler) and llvm-objdump --offloading located the end of a
compressed bundle, and the start of the next one, by scanning for the next
"CCOB" magic string starting right after the current header.

A zstd/zlib-compressed payload can legally contain those four bytes, so the
scan could stop in the middle of the compressed data and truncate the
bundle, corrupting the embedded code object. In practice this produced a
"decomposition" failure for hipBLASLt bf16 GEMMs on gfx942.

Use the authoritative total-size field recorded in the compressed bundle
header (format V2/V3) to compute the exact bundle boundary, and only scan
for the next magic past that point. Legacy bundles without a recorded size
(V1) keep the previous magic-scan fallback.

A skippable-frame fixture that embeds "CCOB" inside the compressed payload
is added to exercise the boundary logic from both clang-offload-bundler and
llvm-objdump --offloading.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list