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
Compiler segfaults (stack overflow in LLVM codegen) when a Vec of a type recursive through Vec is dropped #1557
Found while implementing D61 (#1480), on main ae609cd and the installed v0.15.2.1 alike (not D61-related).
type N { n: i32, next: Vec[N] }
fn main:
let v: Vec[N] = Vec.new()
print(f"{v.len()}")
with build exits 139. check and --emit-c succeed; the crash is inside compile_to_object_backend (LLVM backend), a stack overflow reached from rt_alloc_unlocked (lldb: EXC_BAD_ACCESS at a stack guard address; the frames between the crash and Compilation.prepare_binary_link_from_pool+1296 carry no frame records, so lldb cannot unwind them). The drop of Vec[N] is the trigger: removing the local compiles. Likely the drop-glue/type lowering recursing N -> Vec[N] -> N without a guard.
Repro file used: a Vec-recursive tree in the D61 matrix; D61 tests cover recursion through Box instead until this is fixed.
Activity
Codegen: a collection element's struct drop calls the type's named dr…
Type checker: D74 entry sources and chain moves, field-view bindings (w…