Skip to content

cc --help parity gate down on main: defineProperty-on-non-object at startup — window pins #9326 (indexed writes with a recorded custom array prototype) #9341

Description

@proggeramlug

Symptom

The cc --help parity gate is DOWN on main: the natively-compiled claude-code bundle (cli_2.1.112.js, the standard PERRY_NO_CACHE=1 … --no-auto-optimize --enable-wasm-runtime recipe) exits rc=1 with

Uncaught (in promise) TypeError: Object.defineProperty called on non-object
    at <anonymous>

instead of printing the 9,175-byte help text. Deterministic — three independent binaries, every run:

build SHA cc --help
app_r5 (Aug 31) 83754818e (#9242) PASS — byte-identical to node, rc=0
app_r6 (tonight) 9943dd95c (#9328) FAIL — TypeError above, rc=1
fresh tip build (tonight) a03be729c4 (#9336) FAIL — same TypeError

All three compiled on perrymaster with the same recipe and verified against the same node cli_2.1.112.js --help output (rc=0, 9,175 bytes). The perry-runtime lib suite is green at tip (2904 passed) — the breakage is invisible to it.

Window

83754818e..9943dd95c is 28 commits, but d1bef4c (#9323, "cc --help segfault fixed, parity gate back online") re-verified the gate at its own merge point — which already contains #9300/#9302/#9315/#9316/#9317/#9318. That leaves exactly two commits between the verified-green #9323 and the failing #9328 tip:

so unless #9323's gate claim was not actually run, #9326 is the culprit by elimination.

Mechanism hypothesis, consistent with the error: the bundle retargets array prototypes early (polyfill/subclass boilerplate), which arms the process latch; after that, array[k] / HasProperty on any array with a recorded prototype routes through the new array_spec_get / array_spec_has_index lanes. A read that now yields undefined (or a changed HasProperty verdict feeding an index walk) lands in Object.defineProperty(<that value>, …)throw_object_type_error(b"Object.defineProperty called on non-object") (object_ops/define_property.rs:429).

Repro

ssh perrymaster
export HOME=/tmp/cc_home
/root/claude-shapedesc/app_base --help    # tip a03be729c4 — fails
/root/claude-arch/app_r6 --help           # 9943dd95c — fails
/root/claude-arch/app_r5 --help           # 83754818e — passes, byte-identical

Found while measuring an unrelated runtime change (shape-descriptor no-copy reads) whose A/B had to be moved back to 83754818e because neither arm can pass the gate on current main. Also note: tonight's r6 headline measurement in /root/claude-arch/measure_r6.log silently measured the BROKEN binary (its --help run does ~0.69B instructions vs node's 4.05B because it dies early) — those numbers should be discarded.

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