Repository navigation
debug-check (check 20): gdb round trip; findings 33-34 (gdb printers) - #37
Merged
Merged
Conversation
…es a program defines; findings 33 and 34 Seeded programs build known values of std and user types; gdb prints every local (and *v for boxes and references) at a breakpoint, one -ex each, under a timeout; the output is parsed into a tree and compared structurally with the generator's values, at -Copt-level 0, 1 and 2 (optimized out accepted above 0). gdb's own limitations are labelled expected. 4,000 programs x 3 levels: finding 33 (Vec/VecDeque/slice printers on zero-sized elements: pointer math on an incomplete type, % 0; BTreeMap shows () for every zero-sized key or value) and finding 34 (the Ref/RefMut printer dereferences the NonNull field without unwrapping it); nothing else. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QXiEXbESemwqMLYKaWLDbT
Contributor
Author
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.
Check 20 of
docs/checks.md, the debugger round trip, asmirth-lab debug-check.What it does
Each seed generates a program that builds known values. gdb, loaded with
rust-gdb's pretty-printers, stops at a breakpoint and prints every local, plus*vfor boxes and references. Each command runs as its own-ex, under a timeout. The output is parsed into a tree and compared structurally with the values the generator built, at-Copt-level0, 1 and 2. At levels 1 and 2 an optimized-out value is accepted; a wrong value never is.The values cover:
Ref/RefMutguards, Cellreprand explicit discriminants), and unionsBox<str>,Box<[T]>,Rc<str>,Arc<[T]>, PathBufResults: 4,000 programs × 3 opt levels
Two findings, both in
src/etc/gdb_providers.py. Both reproduce from 1.80.0 through nightly-2026-10-06, and no existing issue turned up for either.% capwhere the stored capacity is 0.(), whatever its type.Ref/RefMutprinter fails on every guard. It dereferences theNonNullfield without unwrapping it, so neither the borrowed value nor the borrow count is shown. No gdb test prints aRef.Four more classes are gdb's own behaviour. They are labelled as expected, with the facts in
docs/checks.md:Box<[Arc<T>]>.Nothing else showed up: no other wrong value, no hang, no gdb crash.
Facts are in
docs/hunt/gdb-printers.md, and the reductions indocs/hunt/tests/debug-check/.rustc/big-run.shnow runs this check too.🤖 Generated with Claude Code
https://claude.ai/code/session_01QXiEXbESemwqMLYKaWLDbT