← Back to Pull requests

pkg/dyninst: live debugger UTF-8 decoding fix #54181

Closed
unknown closed this pull request without merging on Jul 29, 2026 19:59 UTC
View on GitHub
unknown unknown commented on Jul 28, 2026 18:59 UTC
Author

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.

Diff: 206 lines (+154 / -52) across 2 files Reviewer: grantseltzer Review duration: 1499m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.4% (MEDIUM) · Higher = larger blast radius
36.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.4% · Safe to merge
14.4%