nodejs / nodejs/node

RISC-V: "Illegal instruction" crash when vector instructions detected by V8

オープン
#64,538 コメント 36 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

riscv64 v8 engine
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

riscv64 Linux の SpacemiT-K3 で npm または node-gyp を使って再現し、K1 と比較する。また、make run-ci によって実行される build-addons パスも確認する。V8 のベクトル命令に関する変更 de361fd2544a89c0c94fd820f987378edbb98fce を、報告された workaround 1ecdd388f13391c55cffd9aea580770e1d26a952 と併せて読む。K1 でリグレッションを起こさず、これらのコマンドが K3 で Illegal Instruction を発生させなくなれば完了とする。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, linux, node.js
領域
backend, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。