Summary
With the startup chain fixed (#8726/#8738/#8739/#8763), the natively-compiled Claude Code cli.js 2.1.112 bundle now boots and enters the agent loop (--help works; -p progresses through hooks / skills attachment / autocompact per --debug-file). But -p then fails non-deterministically during agent-loop init (num_turns: 0), with a different symptom nearly every run — the signature of GC / heap corruption under the app's allocation churn:
TypeError: (number).get is not a function / (number).set is not a function — a Map/object comes back as a number (its header/box clobbered)
TypeError: Cannot read properties of undefined (reading 'def') — a live object read as undefined
- SIGSEGV —
EXC_BAD_ACCESS, KERN_INVALID_ADDRESS at 0x00000000ff00fff7 (a corrupted/tagged value dereferenced as a raw pointer)
- intermittent hangs
Not fixed by GC pacing
12-run probe: default, PERRY_GC_MOVING_LOOP_POLLS=0, and PERRY_GEN_GC=0 all hang/err; both-off gives the .set error + SIGSEGV. No configuration stabilizes it, so it's not a single pacing knob.
Node parity
node cli_2.1.112.js --help and the agent loop run cleanly under Node — this is perry-runtime GC/memory correctness under a large real workload, i.e. the memory-parity frontier (cf. #7019 scavenge parity and the live-sweep fixes), not an app bug.
Next step to pin it
The shipped binary is stripped. Build a PERRY_DEBUG_SYMBOLS=1 cc (invalidates the codegen cache → full ~50 min recodegen + link; needs ~15 GB transient), reproduce the SIGSEGV, and symbolicate the .ips faulting frames to locate the clobbered allocation / missed root. The reduced-repro will likely be a churn pattern in the agent-loop init (skill/hook registries, token counting) rather than a one-liner.
Found while verifying the natively-compiled Claude Code boots end-to-end after the startup-chain fixes.
Summary
With the startup chain fixed (#8726/#8738/#8739/#8763), the natively-compiled Claude Code cli.js 2.1.112 bundle now boots and enters the agent loop (
--helpworks;-pprogresses through hooks / skills attachment / autocompact per--debug-file). But-pthen fails non-deterministically during agent-loop init (num_turns: 0), with a different symptom nearly every run — the signature of GC / heap corruption under the app's allocation churn:TypeError: (number).get is not a function/(number).set is not a function— aMap/object comes back as a number (its header/box clobbered)TypeError: Cannot read properties of undefined (reading 'def')— a live object read as undefinedEXC_BAD_ACCESS, KERN_INVALID_ADDRESS at 0x00000000ff00fff7(a corrupted/tagged value dereferenced as a raw pointer)Not fixed by GC pacing
12-run probe: default,
PERRY_GC_MOVING_LOOP_POLLS=0, andPERRY_GEN_GC=0all hang/err; both-off gives the.seterror + SIGSEGV. No configuration stabilizes it, so it's not a single pacing knob.Node parity
node cli_2.1.112.js --helpand the agent loop run cleanly under Node — this is perry-runtime GC/memory correctness under a large real workload, i.e. the memory-parity frontier (cf. #7019 scavenge parity and the live-sweep fixes), not an app bug.Next step to pin it
The shipped binary is stripped. Build a
PERRY_DEBUG_SYMBOLS=1cc (invalidates the codegen cache → full ~50 min recodegen + link; needs ~15 GB transient), reproduce the SIGSEGV, and symbolicate the.ipsfaulting frames to locate the clobbered allocation / missed root. The reduced-repro will likely be a churn pattern in the agent-loop init (skill/hook registries, token counting) rather than a one-liner.Found while verifying the natively-compiled Claude Code boots end-to-end after the startup-chain fixes.