You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nested Vec element buffers leak: Vec[Vec[i32]] drop frees the outer buffer only #736
Repro (no loop involved — plain construction + scope exit):
fn main:
var outer: Vec[Vec[i32]] = Vec.new()
var inner: Vec[i32] = Vec.new()
inner.push(5)
outer.push(inner)
print(int_to_string(outer.len()))
WITH_DEBUG_ALLOC=1 with run repro.w
debug-alloc: LEAK addr=... size=16 origin=unknown
debug-alloc: leak count=1
Same leak with a struct in between (type Job { v: Vec[i32] }, Vec[Job]),
and identical under an archived earlier seed, so this is pre-existing, not a
regression from the recent D5/#730 batches.
The 16 bytes are the inner Vec's element buffer: dropping the outer Vec frees
its own buffer but does not run element drop glue that would free each
element's nested buffer. Post-#691 every Vec needs-drop, so element drops
should be emitted here.
Note origin=unknown in the ledger entry — the allocation carries no drop
origin tag, which is itself worth fixing while in this code (the tag is what
makes these reports actionable).
Found while auditing #712's status for the iteration-semantics work.
Closing as invalid after full root-cause — the filing was wrong, twice, and the trail is worth recording.
The nested-Vec drop glue is CORRECT: emission traces show the outer Vec[Vec[i32]] takes the element-walk path (elem needs_drop=1) and the walk emits. The 16-byte 'leak' reproduces in programs with NO nesting at all — including plain 'print(int_to_string(42))' — and splits into two known allocations:
The int-formatting runtime scratch (with_fmt_i64), a runtime-root allocation already exempted by --debug-alloc-filter=non-root.
The false alarm existed because both allocations report origin=unknown in the ledger — no origin tag. That tagging gap is the one actionable residue here and is noted on #691. Verified clean: the original nested repro under --debug-alloc-filter=non-root leaks nothing beyond the str-result allocations.
Activity
ehartford commentedon Jul 28, 2026
Closing as invalid after full root-cause — the filing was wrong, twice, and the trail is worth recording.
The nested-Vec drop glue is CORRECT: emission traces show the outer Vec[Vec[i32]] takes the element-walk path (elem needs_drop=1) and the walk emits. The 16-byte 'leak' reproduces in programs with NO nesting at all — including plain 'print(int_to_string(42))' — and splits into two known allocations:
The false alarm existed because both allocations report origin=unknown in the ledger — no origin tag. That tagging gap is the one actionable residue here and is noted on #691. Verified clean: the original nested repro under --debug-alloc-filter=non-root leaks nothing beyond the str-result allocations.