fix(dyninst): Resolve line probes within their source file #61373
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.42) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 344 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.350
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #61373"
general
weight: 0.35
grantseltzer
What does this PR do?
Line probes now resolve only to line-table rows from the file named by
sourceFile.Previously
pickLineInjectionPCpicked the first row with the requested line number anywhere in the method's PC ranges, ignoring the row's file. A probe could land in code inlined from another file, and a probe whosesourceFilenamed a different file still installed, with snapshots reporting thatsourceFile.Now a row is considered only when its recorded file and
sourceFilematch on path-component boundaries: either path may be a trailing part of the other, so base names, repository paths, module paths and build paths all match.\,./,//and leading/or../are normalized; asourceFilewith..after a named component, or with no named component, is rejected. A line probe whosesourceFilematches no row at that line fails with an invalid probe definition.When
sourceFilematches several files, the closest match is used: an exact recorded path first, then a recorded path that contains all ofsourceFile. Among equally close matches, the method's declaring file comes first, then files of the method's own code, then files of code inlined into it; the caller's line state at the start of inlined code counts only when no row of the method's code at that line matches. A compiled copy of the method (an inlined instance or a generic shape) whose code at the line is only in other files is skipped, so the probe still installs in the copies that have it.Motivation
Snapshots report
sourceFileas the probe's file, so it should name the file the probe was actually placed in.Possible drawbacks / trade-offs
A
sourceFilewhose trailing components differ from the path recorded in the binary no longer matches. Examples: a-trimpathbuild whose module path differs from the repository directory (moduleexample.com/apiinservices/api/,sourceFileservices/api/x.go), a Docker build that copies a subdirectory to/app, or a module-cache path with@vXwhensourceFileomits the version. These probes installed before. Reviewers from Dynamic Instrumentation: please confirm which path form the UI sends for Go line probes.Describe how you validated your changes
TestLineProbeSourceFile(GenerateIRonrc_tester): mismatching and..cases fail on the base commit and pass with this change.TestLineFileMatchesandTestPickLineInjectionPCcases.pkg/dyninst/irgen,rcjsonanddecodetests pass on linux/arm64; irgen snapshot goldens (amd64 and arm64 binaries, go1.23–1.27) are unchanged. linux/amd64 compile-checked.pkg/dyninstend-to-end andpkg/dyninst/moduletests (CI eBPF jobs).