Skip to content

Stack #1898 (ABI v8, #1869): the seed-built action runner crashes in rt_compat_setenv_str — the tree runtime source assumes v8 &str, the pinned v7 seed compiles both sides #1908

Closed

Description

@ehartford

Found while measuring build speed on a branch stacked on #1898 (top 591d9c5 + build-layer edits).

Symptom. Every action fails with the native runner dying at startup (exit 138 SIGBUS / 139 SIGSEGV), layout-dependent: the same tree ran the whole battery at 01:11, and a one-token change to a string literal in build/compiler.w made the runner crash on every start.

Exact site (lldb on the seed-built out/.build-state/build-runner):

breakpoint rt_memcpy -c '$x2 > 1000000000'
  x0 = 0x0000000300000010
  x1 = 0x0000000100374170  CALG_TESTS_DIR + 160      (string bytes)
  x2 = 0x00000001003768e0  CALG_TESTS_DIR + 10256    (length = an address)
frame #1 with_memcpy
frame #2 rt_compat_setenv_str + 80
frame #3 __with_main + 68        (runner's first statement: set_env("WITH_BUILD_TOOLFS_SUPPRESS", "1"))

The copy length is another string's address: caller and callee disagree on how a &str argument is passed.

Why. The runner is compiled by the pinned seed (ABI v7: &str is one pointer) against out/bootstrap-lib, whose objects the seed also compiles (.producer = foreign:cffa4a40…) — but from the TREE's runtime source (out/gen/compat_runtime.w, rt/*.w), which on this stack is written for ABI v8 (&str is {ptr, len} by value; #1869, 08db095c "read a &str's bytes through s as *const str", 196aab2e "a runtime &str parameter binds C's by-value with_str"). Source written for v8, compiled under v7 semantics, called by v7 code: a mixed world (#761 class) inside one generation's build.

Confirmation. With the branch's own release compiler as the driver (v8 compiles the runner), the same tree's runner starts and tools-tests passes.

What it means. The stack is not reliably bootstrappable from the pinned seed (CLAUDE.md "Every PR must be bootstrappable"); whether a battery passes depends on register contents. The ABI v8 layer needs either source that is correct under both conventions while the v7 seed builds it, or a staged seed (cut a v8-capable seed first), before the stack's battery can be trusted.

Activity

  1. ehartford commented on Sep 29, 2026

    @ehartford
    ContributorAuthor

    Root cause, one level below the ABI change: the pinned seed's driver links its runner against out/lib whenever out/lib holds the probe objects, trusting prepare-bootstrap-link-root to have removed them; that target was cached across build/ edits (its inputs were a few runtime sources), so after the tree rebuilt out/lib, a runner recompile linked the tree's runtime. Evidence: nm -pa OSO entries — crashing runner out/lib/{rt_core,compat_runtime,rt_darwin_aarch64,...}.o, fixed runner out/bootstrap-lib/.... Fix: the target keys on the runner's own inputs (build.w, build/, lib/std/build.w), so every runner recompile re-prepares the link root first. Verified seed-driven on the stack tree (tools-tests passes). The same mixed link happens silently on main; the fix lands on main via the speed branch.

  2. ehartford commented on Sep 29, 2026

    @ehartford
    ContributorAuthor

    Fixed by #1909 (main 2fa54a7): prepare-bootstrap-link-root keys on the runner's own inputs, so a runner recompile always re-prepares the link root first. Installed compiler v0.15.3.0-g2fa54a719.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions