fix(scheduler): close core_clock.c isolation-test coverage gap (bug-1827)

core_clock.c joined the mechanically-enforced isolation archive
(sched_core_isolation_lib) and its own doc comment claimed coverage by
the forbidden-headers/forbidden-symbols text scans, but was actually
absent from both -- only the nm(1) undefined-symbol layer covered it,
which cannot catch a forbidden #include resolving to no undefined
symbol (a macro-only header).

Added XCE_CORE_CLOCK_C_PATH (meson.build, mirroring the existing
per-file path macros) and extended both
test_core_never_includes_forbidden_headers() and
test_core_never_calls_forbidden_symbols() to scan core_clock.c. It
remains excluded only from the wall-clock scan, for its one sanctioned
clock_gettime() call.

TDD: confirmed RED by temporarily inserting a forbidden #include into
core_clock.c (84/85, correctly attributed failure), reverted
(byte-identical to HEAD), reconfirmed GREEN (85/85). No live violation
existed -- this closes a coverage gap in the mechanism itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
Rongsong Shen 2026-09-19 14:45:20 +00:00
parent a6657d05a7
commit 4db992b5e4
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
3 changed files with 43 additions and 12 deletions

View file

@ -24528,7 +24528,7 @@
"error_message": "NOT A CRASH -- coverage gap found during an /xce-audit-invariants scheduler run (dimension 2: core module I/O isolation), while investigating driver state-equivalence for bug-1826. test_core_isolation.c's own header comment claims core_clock.c joins ONLY the nm(1) undefined-symbol enforcement layer, not the wall-clock text-scan check -- implying it is still covered by the OTHER two text-scan checks (forbidden #include list, forbidden symbol substrings). In reality, core_clock.c is absent from all three text-scan functions (test_core_never_includes_forbidden_headers(), test_core_never_calls_forbidden_symbols(), and the wall-clock scan), not just the wall-clock one -- no XCE_CORE_CLOCK_C_PATH macro is defined anywhere in test_core_isolation.c or testsuite/meson.build's c_args for that test.",
"file": "src/scheduler/testsuite/test_core_isolation.c",
"root_cause": "core_clock.c was added to the mechanically-enforced sched_core_isolation_lib archive (meson.build) and given a documented single exception (the wall-clock text scan, for its one sanctioned clock_gettime() call), but the two OTHER text-scan functions (forbidden-headers, forbidden-symbols) were never extended to also read core_clock.c's source text -- only core.h/core.c/core_events.c/core_session.c are read by those two checks (via XCE_CORE_H_PATH/_C_PATH/_EVENTS_C_PATH/_SESSION_C_PATH macros; no clock-file variant exists). The nm(1) undefined-symbol layer (which DOES include core_clock.c in the archive) only catches an actual undefined-symbol reference at link time -- it cannot catch a bare forbidden #include (e.g. client.h/netio.h/xceapi.h/delay.h/idgen.h/xce/cluster.h) that resolves to no undefined symbol (a macro-only or inline-only header), so the doc comment's implied coverage is narrower in practice than stated. No evidence found that core_clock.c's actual current content violates isolation today -- this is a gap in what the mechanism would CATCH if it did, not a confirmed live violation.",
"fix": "NOT FIXED -- audit-only finding, reported to the user for triage, not bundled into the concurrent scheduler-sim-limit-matching spec work. Straightforward fix when picked up: add a XCE_CORE_CLOCK_C_PATH macro (testsuite/meson.build's c_args for test_core_isolation) and extend test_core_never_includes_forbidden_headers()/test_core_never_calls_forbidden_symbols() to also scan core_clock.c's source text, matching the coverage the file's own doc comment already claims it has.",
"fix": "FIXED (2026-09-19). Added XCE_CORE_CLOCK_C_PATH (testsuite/meson.build c_args for sched_core_isolation_test, mirroring the existing XCE_CORE_H_PATH/_C_PATH/_EVENTS_C_PATH/_SESSION_C_PATH pattern) and extended both test_core_never_includes_forbidden_headers() and test_core_never_calls_forbidden_symbols() (test_core_isolation.c) to also scan core_clock.c -- it remains excluded ONLY from the wall-clock scan (test_core_never_calls_wallclock_functions), for the same sanctioned-single-clock_gettime()-call reason as before. TDD: confirmed RED by temporarily inserting #include \"netio.h\" into core_clock.c and rebuilding -- the extended test correctly failed with the message \"core_clock.c directly includes forbidden header '#include \"netio.h\"'\" (test_core_isolation.c:226) while every other test stayed green (84/85); reverted (git diff confirms core_clock.c byte-identical to HEAD) and reconfirmed GREEN (85/85). No live violation existed in core_clock.c -- this closes the coverage gap the mechanism itself had, matching what its own header/doc comments already claimed.",
"tags": [
"scheduler",
"core-isolation",
@ -24536,12 +24536,11 @@
"test_core_isolation",
"core_clock",
"audit-finding",
"unfixed",
"discovered-during-xce-audit-invariants",
"not-fixed"
"fixed"
],
"occurrences": 1,
"last_seen": "2026-09-19T09:00:00Z"
"last_seen": "2026-09-19T14:30:00Z"
},
{
"id": "bug-1828",