Summary
make -C native/kernel test stops at gsp-cot-test when the host tool is built with gcc 13. The self-test reports CK_GSP_COT_ENCODE_SELFTEST: FAIL (50 failures). Each refusal check sees the previous check's why string, so every failure is shifted by one.
This happens on main. The failure was seen while refreshing #426, and there native/kernel/tools/ck_gsp_cot_encode.c is byte-identical to main at b00c728c2443d8931e8e697a25d67f5e20e408ca (checked with git diff --quiet origin/main -- native/kernel/tools/ck_gsp_cot_encode.c). The #426 refresh did not cause it, and this issue does not propose a fix yet.
Likely cause
The refusal checks in the self-test are written like this:
expect_refused(cot_mctp_header(1, 1, 0, 4, &h, &why), why, "seq out of range", "mctp seq 4");
cot_mctp_header() writes the reason through &why, and the same call also passes why by value as an argument to expect_refused(). C leaves the evaluation order of function arguments unspecified. If the compiler reads why before it calls cot_mctp_header(), expect_refused() gets the stale string from the previous check. The other refusal checks (cot_nvdm_header, the payload and params mutations) follow the same pattern.
The gcc 13 output fits this. mctp seq 4 gets an empty why, and from then on each check gets the reason its predecessor expected:
FAIL refused: mctp seq 4 (rc=-1 why= want=seq out of range)
...
FAIL refused: decoded desc size 512 (rc=-1 why=bIsGspRmBoot not set want=descriptor size not 256)
FAIL refused: params 87 bytes (rc=-1 why=descriptor size not 256 want=params length not 88)
CK_GSP_COT_ENCODE_SELFTEST: FAIL (50 failures)
make: *** [Makefile:2035: gsp-cot-test] Error 1
The return codes are right (rc=-1 every time), so the encoder itself seems to refuse correctly. Only the test harness's capture of the reason is wrong. That is still an inference from the output: nobody has checked it against an order-independent harness yet.
Reproducer (on main, gcc 13.x)
gcc -std=gnu11 -O2 -Wall -Wextra -Werror -I native/argus \
-o /tmp/ck_gsp_cot_encode native/kernel/tools/ck_gsp_cot_encode.c native/argus/sha256.c
/tmp/ck_gsp_cot_encode selftest | grep -E 'FAIL|SELFTEST'
# or: make -C native/kernel HOSTCC=gcc gsp-cot-test
This was seen with gcc 13.3 on a Cursor cloud VM (Ubuntu). A quick clang 18 build of the same file was tried in the same session, but its output wasn't captured, so we don't know whether clang passes. Someone should re-run it before assuming the failure is gcc-only.
Does CI catch it?
No, PR CI currently misses it.
make -C native/kernel testruns only through theAIENOS-CK-HOST-TESTSgate (tests/gates/aienos-ck-host-tests.gate), which hasrequires: host.- The "AIEN Checks" job in
.github/workflows/aien-verification.ymlruns only the portable smoke set: gates whoserequireslist is justportable. On main,AIENOS-ZERO-DISK-SECRETSis the only such gate. - The gate file's header comment says it mirrors
ck-kernel.yml, but nock-kernel.ymlexists in.github/workflows/on main. The workflows there areaien-verification.yml,sbom.ymlandcopilot-setup-steps.yml.
The gate would run in a full whole-system run on the Spark. Whether it fails there depends on which host compiler the Spark uses, and that hasn't been checked (hardware-unverified). Until this is fixed, any host where HOSTCC is gcc 13 stops make -C native/kernel test at this target, and every test target listed after gsp-cot-test is skipped.
Done when
- The
gsp-cot-testself-test gives the same verdict whatever order the compiler evaluates arguments in (at least gcc 13 and clang). make -C native/kernel HOSTCC=gcc testgets pastgsp-cot-test.- A follow-up decision on whether PR CI should cover this (it is currently host-only) is either made or split into its own issue.
— Grokbot