Skip to content

Test loops that exit when their counter wraps around - #696

Merged
maleadt merged 1 commit into
mainfrom
tb/igc-find-crash
Oct 15, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/igc-find-crash

Conversation

@maleadt

@maleadt maleadt commented Oct 14, 2026

Copy link
Copy Markdown
Member

Regression test for the Julia 1.12 CI crash in gpuarrays/indexing find (since build 1785, the GPUArrays 12 bump): findmax(abs, x) under --check-bounds=yes aborted with free(): invalid next size (fast) inside libigc during zeModuleCreate.

The SPIR-V back-end lowers i += 1; i == 0 to OpIAddCarry, and IGC's optimizer sinks the extracts of the {i64, i1} result through the loop PHI. IGC's legalization (libigc 2.34.4 through 2.41.x) then erased the intrinsic while that PHI still referenced it, a use-after-free that code generation read later. Whether glibc notices is heap-layout dependent, which is why only the 1.12 job crashed while 1.13 passed with a corrupted heap; under a guard-page allocator the read is deterministic.

The fix is backported in libigc_jll 2.34.4+5 (JuliaPackaging/Yggdrasil#15125; the first attempt in JuliaPackaging/Yggdrasil#15103, 2.34.4+4, still double-freed the split PHI). Intel fixed the same bug independently in intel/intel-graphics-compiler@522dc7026 (v2.42.0). Nothing changes on the oneAPI.jl side besides this test, whose kernel is the minimal shape that triggers the bug.

CI on 1.12 goes green once libigc_jll 2.34.4+5 is registered.

@maleadt
maleadt marked this pull request as draft October 14, 2026 10:33
@maleadt
maleadt marked this pull request as ready for review October 14, 2026 13:17
The SPIR-V back-end lowers `i += 1; i == 0` to OpIAddCarry, and IGC's
optimizer carries the {i64, i1} result through the loop PHI. IGC's
legalization (libigc 2.34.4 through 2.41.5) then erased the intrinsic
while the PHI still referenced it: a use-after-free that aborted the
Julia 1.12 CI job in `findmax(abs, x)` under `--check-bounds=yes` and
corrupted the heap silently elsewhere. Fixed by the IGC backport in
libigc_jll 2.34.4+5.
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.65%. Comparing base (29e164e) to head (3b3b7cc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #696      +/-   ##
==========================================
- Coverage   81.35%   80.65%   -0.70%     
==========================================
  Files          52       51       -1     
  Lines        4092     3971     -121     
==========================================
- Hits         3329     3203     -126     
- Misses        763      768       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit 218dc51 into main Oct 15, 2026
4 of 5 checks passed
@maleadt
maleadt deleted the tb/igc-find-crash branch October 15, 2026 05:48
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