Repository navigation
test: DAP/JSON channel marker-leak golden cell (Refs #3018) - #3073
Merged
Merged
Conversation
Drives a real --dap session over the binary's stdio (lock-step client in-file) and reads marker-carrying values back through variables + evaluate. The channel renders storage encoding today, so the value legs are pinned inverted per this file's registry precedent; the finding, repro and localization are in the lane REPORT. Header gap note removed: every section 2.1 channel now carries a cell. Test-only; src/ untouched.
caomengxuan666
marked this pull request as ready for review
November 8, 2026 04:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3018
What this is
Test-only: the E6 per-channel golden enumeration in
tests/marker_leak_golden.rshad exactly one §2.1 channel with no cell — the debugger/JSON (DAP) face, recorded as an explicit gap in the file's header comment (sweep Q2). This PR closes that gap with a real cell and removes the gap note; every §2.1 channel now carries a cell.The harness
A lock-step DAP client inside the golden file drives the shipped binary the way an editor would: it spawns
rubash --dapwith a sanitized environment (mirroring the file'srun_clean_env), speaks Content-Length framed JSON over the child's stdio, and runs a full session —initialize→launch→initialized→setBreakpoints→configurationDone→stopped(breakpoint) →stackTrace→scopes→variables(Globals + array children) →evaluate→continue→exited/terminated→disconnect. The client shape follows the in-process fixtures ofsrc/debugger/dap_tests.rs; it carries a minimal JSON value type because the debugger module is crate-private. A stalled conversation panics with the transcript instead of hanging (120 s per-read timeout), and the cell asserts the debuggee actually ran (its stdout arrives as anoutputevent, exit code 0, server exits 0).The finding: the DAP channel leaks storage encoding (cell pinned inverted)
The fixture program binds marker-carrying values — a typed U+E314 char, a raw ESC byte, raw C0 bytes, and an array holding both — and the cell reads them back through the
variablesandevaluatefaces. On the current tree both faces render internal storage encoding instead of the decoded values every other channel produces:puaescAU+E000 U+E01CBAESCBc0aU+E000 U+E012bU+E000 U+E020ca0x11b0x1Fcarr[0]arr[1]xU+E000 U+E012yx0x11y$pua/$esc/$c0Localization (read-only; no product code touched): the snapshot face captures storage forms —
Executor::capture_variableinsrc/executor/state_views.rsbuilds scalar values from the raw env mirror / typed store — and the DAP value renderers print them verbatim; no decode step (the sanctioned decoder family used by the output channels) runs on this face. The one rendering the channel already gets right is pinned as the control: the parenthesized array summary renders decoded, exactly likedeclare -p(([0]="<U+E314>" [1]=$'x\021y')).Following this file's registry-test precedent (the #3038 / #3040 legs in the same file), the value assertions are pinned inverted: they assert the current broken renderings and will flip red the moment a fix decodes the face. The transcript leg is likewise inverted for the carrier codepoints (U+E400 / U+E000 present today); the named-marker transcript leg (
__RUBASH_*) is a straight assertion and passes. Fail-first evidence: the cell with correct assertions fails on this tree —left: "\u{e400}\u{e314}"vsright: "\u{e314}"at the first value assertion (full repro, codepoint tables and localization in the lane REPORT,~/workspace/fix-3018/REPORT.md). The leak itself is not fixed here — this lane is test-only by assignment; the follow-up fix needs its own issue.Verification (lane-run; UNVERIFIED-BY-CAPTAIN)
-D warningsbuild of the golden target: rc=0. Hygiene (bash scripts/check-utf8-boundary-hygiene.sh): clean, rc=0.cargo fmt --checkclean; zero CR in the file.本 PR 删除了什么
Nothing is deleted from the product or the suite. The only removal is the header comment's known-gap paragraph in
tests/marker_leak_golden.rs(the debugger/JSON channel is no longer a gap — that is the point of the change). Pure test PR: +793 / −5 in one test file,src/untouched.UNVERIFIED-BY-CAPTAIN