delve: add linux-riscv64 support #3785
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 · 193 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.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3785"
general
weight: 0.35
lrzlin
This patch adds linux-riscv64 support to delve, tested under go 1.22.5/ubuntu 24.04 riscv64 & go 1.21.4/openEuler 24.03 riscv64.
It's worth noticing that due to riscv64 do not support
PTRACE_SINGLESTEP, just like arm32, so we insertebreakto emulate it. The__NR_riscv_flush_icachesyscall is used to avoid self modify code's TOCTOU error, but I wasn't able to find any difference withsys.PtracePokeData. So it still needs some kinds of validation.To support CGO, we have to insert
c.ebreakinstead ofebreakas breakpoint due to gcc/clang will enable c extension by default, and useebreakas altbreakpoint, but due to a arm64 specific workaround, it can not handle hardcoded breakpoint correctly, so I disabled it on riscv64 platform.Most of tests were passed, the few failed tests seems to be related with riscv64 go compiler itself, for example, the strange repetition in
TestTraceDirRecursion, just like this:I tried to disable the asyncpreemt, but unfortunately, It doesn't work.
Also, the riscv64 x/arch support hasn't been merged to upstream, so I use
-mod=vendorhere as a workaround.