Skip to content

uci-comb has no offline handshake rig — rig_https_local cannot allocate scratch on it #209

Description

@JC-000

tools/uci/rig_https_local.py cannot run against the uci-comb product on either tree. It dies in MemoryArbiter.alloc before touching the device, so c64-https-uci-comb.prg — the fastest shipped product — can be handshake-tested only against the live internet, via rig_https_banner.py.

Measured, master 48657f5, PRG 5aa224d455fb4d355150896ee33fa2c9ae2faf18f113339b75c9ddc087cab9fa (BACKEND=uci USE_NISTCURVES_ONCHIP_COMB=1 HTTPS_SNI=www.foo.invalid):

  File "tools/uci/rig_https_local.py", line 1412, in main
    ROUTINE_ADDR    = arbiter.alloc(256, name="trampoline")
c64_test_harness.memory_arbiter.MemoryArbiterError: MemoryArbiter.alloc(size=256, alignment=1, name='trampoline') found no free range.
Trace:
  free $5F71-$5FFF (143 B) too small for 256 B @ alignment 1

The rig needs 387 B (256 trampoline + 64 host_str + 64 path_str + 3 one-byte sentinels). Available in the CRYPTO_OVERLAY tail:

tree last segment tail free needed
master 48657f5 LIB_NISTCURVES_MUL_CODE ends $5F70 $5F71-$5FFF 143 B 387 B
e4fda6d LIB_NISTCURVES_MUL_CODE ends $5F66 $5F67-$5FFF 153 B 387 B

CLAUDE.md records this hazard at 223 B ("server-name validation took the comb tail from 714 to 223 B"). It has drifted to 143 B and nobody noticed, because the rig has never been pointed at comb: both its docstring and tools/uci/README document its build as USE_NISTCURVES_ONCHIP=1.

A predicted fix was probed and did not deliver. Gating the P-384 objects out of the link (on e4fda6d) was expected to return ~299 B of CRYPTO_AUX_CODE to CRYPTO_OVERLAY. It returns +10 B on uci, because UCI routes CRYPTO_AUX_CODE into NET_CODE, not CRYPTO_OVERLAY — that recovery lands in CRYPTO_OVERLAY only on ip65. Roughly the 33 B of CRYPTO_RODATA reaches the comb tail, minus nistcurves MUL_CODE growth. Do not expect the P-384 lane's retirement to fix this.

Shape of the missing test. A ~40-line monkeypatch of rig_https_local's HTTP_RESPONSE/EXPECTED_BODY — the same override seam rig_https_print_body.py already uses — is enough to drive an offline body test end to end; that throwaway is what produced the measurements in the silent-truncation issue. What is missing is somewhere to put 387 B of scratch under comb, not the test logic.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions