RISC-V: "Illegal instruction" crash when vector instructions detected by V8
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.3k
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 283
描述
Version
v26.5.0 (but any v26 and above is affected)
Platform
Linux firefly 6.18.3 #2 SMP PREEMPT_DYNAMIC Wed May 13 16:58:11 CST 2026 riscv64 GNU/Linux
Subsystem
V8
What steps will reproduce the bug?
run npm or any node-gyp on a SpacemiT-K3 board. Also fails in the build-addons step with make run-ci as that executes node-gyp. Other boards such as the SpacemiT-K1 do not show the crash (Both should have vector instructions available)
How often does it reproduce? Is there a required condition?
100% of the time
What is the expected behavior? Why is that the expected behavior?
There should be no crash when running npm
What do you see instead?
Illegal Instruction
Additional information
Based on the fact that https://github.com/sxa/node/commit/1ecdd388f13391c55cffd9aea580770e1d26a952 fixes it seems likely that this was introduced as part of the vector instructions introduced in https://github.com/v8/v8/commit/de361fd2544a89c0c94fd820f987378edbb98fce - I haven't yet tracked it down to any specific operation in that function. At the moment I've also only determined that it fixes the initial crash and hopefully that doesn' uncover more issues.
FYI @luhenry @luyahan @nodejs/platform-riscv64
Split out from https://github.com/nodejs/build/issues/4099#issuecomment-4935757486
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在运行 riscv64 Linux 的 SpacemiT-K3 上使用 npm 或 node-gyp 重现,并与 K1 对比;同时检查由 make run-ci 运行的 build-addons 路径。结合报告的 workaround 1ecdd388f13391c55cffd9aea580770e1d26a952,阅读 V8 的向量指令变更 de361fd2544a89c0c94fd820f987378edbb98fce。完成标准是:这些命令在 K3 上不再引发 Illegal Instruction,且不会导致 K1 回归。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, linux, node.js
- 领域
- backend, operating-systems
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100