pkg/dyninst: live debugger UTF-8 decoding fix #54181
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 206 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.319
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #54181"
general
weight: 0.35
grantseltzer
What does this PR do?
The Go live debugger reads values straight out of a running program's memory, and that text is not always valid UTF-8. A string can hold arbitrary bytes, a value trimmed to a length limit can be cut through the middle of a character, and a type name looked up while the program runs can come back as junk. The snapshot writer refused to record any of these, so the value disappeared from the snapshot entirely, and if the bad text was in the log message, the stack, or a field name, the whole snapshot was thrown away.
Now the bad bytes are replaced and the value is kept, long values are trimmed at character boundaries instead of mid-character, and a type name that can't be read is reported as unknown. That last one also stops the debugger from repeatedly rebuilding its instrumentation to chase a type that can never resolve.
Motivation
A user lost captured variables with no visible explanation. In their place the snapshot carried an internal serializer error, which read like their own request had failed when nothing of theirs had. A value the user can partly read is far more useful than one that silently vanished.
Describe how you validated your changes
Two commits. The first adds tests and fails: four decoder tests fail, and the end-to-end test against a real compiled program comes up two events short because those events are being dropped. The second adds the fix and everything passes, including the end-to-end test, which needs root.
The tests were written before the fix existed and were not changed by it.
Additional Notes
Please review as a stack, tests first.