Repository navigation
-mm=rc: the array splice gives back is born owned (release blocker, TSLANG 206) - #1042
Merged
Merged
Conversation
… being returned (TSLANG 206) The release run of 2026-11-26 failed every time on array_class_splice.ts (-mm=rc, debug JIT, Ubuntu 22.04/24.04) with no output. Cause: mlirGenArraySplice marks splice's result owned, so its receiver takes the reference over instead of retaining, but ArraySpliceOpLowering made the header with ArrayLayout::make, whose block is born with no reference. `const removed = this.data.splice(...); return removed;` (the default library's Array<T>.splice) retained it to 1 for the return and released the local to 0: the caller got a freed array, later allocations wrote over it and mimalloc's free list, and the next splice crashed in mi_malloc. Under rc the header is now born with that reference, as an owned `new C()`'s is (NewOpLowering). It was not the CPU: CI starts every pass with a cold JIT cache (a warm one passed), and on Windows the freed block happened to survive. Checked in docker ubuntu:22.04/26.04 with the release run's package and default library: unfixed 3/3 crashes and 7 invalid accesses under valgrind, fixed 0 and 0. Test 00rc_splice_result_owned.ts (gc, rc, none): pre-alpha134 crashes on it on Windows. Co-Authored-By: Claude Opus 5.5 <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.
Fixes the release run failure of 2026-11-26 (run 45878505115):
array_class_splice.tsunder-mm=rc, debug JIT, crashed with no output on Ubuntu 22.04/24.04 on every attempt.Cause.
mlirGenArraySplicemarks splice's result owned, so its receiver takes the reference over instead of retaining.ArraySpliceOpLoweringbuilt the result header withArrayLayout::make, whose block is born with no reference. In the default library'sArray<T>.splice(const removed = this.data.splice(...); ...; return removed;) the return retained it to 1 and the local's release took it to 0, so the caller got a freed array. Later allocations wrote over it and over mimalloc's free list, and the nextsplicecrashed inmi_malloc.Fix. Under rc, the header is born with that reference when the op is marked owned, as an owned
new C()'s is (NewOpLowering).Why only CI. It is not the CPU. CI starts every
tests.shpass with a cold JIT cache, and a warm cache passed. On Windows the freed block happened to survive. The IR is the same in pre-alpha134, so this is not new.Checked
00rc_splice_result_owned.ts(gc, rc, none): pre-alpha134 crashes on it on Windows.🤖 Generated with Claude Code