Skip to content

Task #115: zimg NEON float vertical resize over-read (arm64 ASan) — report, no code change - #279

Merged
StuartCameronCode merged 3 commits into
mainfrom
stuart/115-linux-arm64-gcc-13-asan-zimg-67e06032-re
Nov 27, 2026
Merged

StuartCameronCode merged 3 commits into
mainfrom
stuart/115-linux-arm64-gcc-13-asan-zimg-67e06032-re

Conversation

@StuartCameronCode

Copy link
Copy Markdown
Owner

Task #115. Task #109 found that 32 of its 158 zimg test cases abort under gcc 13 AddressSanitizer on linux-arm64 (heap-buffer-overflow), at every graphengine commit, the commit Linux ships included. This PR finds the cause and shows that what we ship is not affected. No VapourBox code changes.

Finding

zimg's resize_line_v_f32_neon<Taps, Continue> always loads 8 filter coefficients. On ARM, a vertical float filter with 4 or fewer taps has rows only 4 floats long, so on the last output row the kernel reads up to 16 bytes past the coefficient vector. The extra values are never used. The bug is in 67e06032 (our pin) and in zimg master 9806db42.

Evidence from two ubuntu-24.04-arm runs (45994602531, 45995908194):

  • All 32 aborts are READ of size 4 in <1, false> or <4, false>, 0 bytes past a coefficient vector of output rows × 16 bytes.
  • With every frame plane padded by 4096 bytes, the same 32 abort, so the test harness is not the cause.
  • A one-function zimg patch gives 0 aborts, and all 158 output CRCs are identical.
  • clang 18 ASan reports nothing.
  • The -O3 build VapourSynth makes emits none of the extra loads (checked in the disassembly), and valgrind is clean on it.
  • The shipped deps-v1.18.0-rc4 linux-arm64 bundle is clean under valgrind.

Changes

  • docs/reports/task-115-zimg-neon-v-f32-overread/: the report, scripts (asan_report.sh, bundle_check.sh, upstream_repro.c, the zimg patch), the data from both runs, and a draft upstream issue (not filed).
  • .github/workflows/zimg-neon-asan.yml: an arm64 workflow that runs the evidence. It runs only when dispatched, or when the workflow file changes on a non-main branch.
  • Task Sharpening workflow order #109's scripts gain --pad and --crc (tmp_overrun.c), KEEP_ERR (run_cases.sh) and ZIMG_PATCH (build.sh). All are additive, and the defaults are unchanged.
  • ENGINEERING_NOTES entry, reports README row, and a dated pointer in Sharpening workflow order #109's report.
  • CLAUDE.md: under gcc ASan on arm64, these 32 aborts are expected and don't block a zimg bump; any other arm64 abort does.

Testing

  • The two arm64 CI runs above.
  • zimg_pin_test.dart and readme_pipeline_order_test.dart pass; the deps_delta_install and crash_report_classifier tests passed in the earlier stage.
  • bash -n is clean on all scripts.

🤖 Generated with Claude Code

StuartCameronCode and others added 3 commits November 28, 2026 01:19
…over-read

build.sh takes ZIMG_PATCH; tmp_overrun.c takes --pad and --crc;
run_cases.sh keeps aborted stderr with KEEP_ERR. asan_report.sh and
bundle_check.sh run the controls on ubuntu-24.04-arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ient over-read

All 32 linux-arm64 gcc ASan aborts are resize_line_v_f32_neon reading
filter_data[4..7] past a <=4-tap filter's coefficient vector. Padded frames
change nothing; a one-function patch removes them with identical output;
clang ASan, the shipped -O3 build and the rc4 bundle under valgrind are
clean. No VapourBox change; CLAUDE.md says the 32 don't block a zimg bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StuartCameronCode
StuartCameronCode force-pushed the stuart/115-linux-arm64-gcc-13-asan-zimg-67e06032-re branch from 64039a0 to 147c8e1 Compare November 27, 2026 14:19
@StuartCameronCode
StuartCameronCode merged commit 9962ff4 into main Nov 27, 2026
14 checks passed
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