riscv64: every script segfaults in Runtime_InstallBaselineCode since v24.22.0 (backport of V8 0b94a9fd23ba dropped the runtime argument)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- c, cpp, javascript
調査の方向性
#65753 の V8 のバックポートから始め、deps/v8/src/codegen/riscv/macro-assembler-riscv.cc、特に MacroAssembler::GenerateTailCallToReturnedCode を調べてください。レジスタの push を v24.21.0 および main と比較し、その後 riscv64 でビルドして out/Release/node -p 1+1 を実行してください。コマンドがセグフォルトせずに 2 を出力すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version
v24.22.1, built from source. v24.22.3 and the head of v24.x carry the same line. v24.21.0 and main are not affected.
Platform
Linux 6.18 riscv64 (SpacemiT K3), Ubuntu 26.04, gcc 15.2, `./configure --openssl-no-asm`
Subsystem
deps (V8, riscv64 port)
What steps will reproduce the bug?
Build v24.22.1 natively on riscv64 and run any script:
$ out/Release/node --version
v24.22.1
$ out/Release/node -p 1+1
Segmentation fault (core dumped)
--no-sparkplug and --jitless both avoid it.
How often does it reproduce? Is there a required condition?
Always, on the first function that takes the baseline path.
What is the expected behavior? Why is that the expected behavior?
2
What do you see instead?
Thread 1 "MainThread" received signal SIGSEGV, Segmentation fault.
#0 v8::internal::Runtime_InstallBaselineCode(int, unsigned long*, v8::internal::Isolate*) ()
#1 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit ()
Additional information
#65753 (backport of V8 0b94a9fd23ba, in v24.22.0) rewrote MacroAssembler::GenerateTailCallToReturnedCode in deps/v8/src/codegen/riscv/macro-assembler-riscv.cc. The Push went from four registers to three and lost the second kJavaScriptCallTargetRegister, which is the one argument of the CallRuntime(function_id, 1) that follows. The runtime function then reads the slot below as its argument: in the crash args[0] is 0x100000000, the Smi-tagged argument count, not a JSFunction. The disassembly of Builtins_InterpreterEntryTrampoline shows three stores before the call; the v24.21.0 source pushes four.
main pushes the function separately before the call, so only the backport is affected. Restoring the register fixes it:
--- a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
+++ b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
@@ -202,7 +202,7 @@
Push(kJavaScriptCallDispatchHandleRegister);
#endif
Push(kJavaScriptCallTargetRegister, kJavaScriptCallNewTargetRegister,
- kJavaScriptCallArgCountRegister);
+ kJavaScriptCallArgCountRegister, kJavaScriptCallTargetRegister);
CallRuntime(function_id, 1);
// Use the return value before restoring a0
With that line a native build runs JavaScript, workers, child processes and npm. I have not checked whether the unofficial riscv64 binaries of 24.22.x show the same crash.
- 主要言語
- JavaScript
- スター
- 124k
- フォーク
- 38.1k
- 平均マージ
- 4日 21時間
- マージ済み PR(30日)
- 242
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/node のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nodejs/node#67643 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
util: parseArgs() treats a `-` inside a short option group as the `--` terminator対応中かも @yohannesjoya が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
util.parseEnv and --env-file keep a leading UTF-8 BOM in the first key対応中かも @helmipradita が 21 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
node:internal/inspector/network_http: `TypeError: Missing dataLength` in event when response uses `setEncoding()`再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nodejs/node#66551 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Stream.prototype.forEach will block in first promise in queue before read more chunk対応中かも @mmustafasenoglu が 56 日前に担当しました。 オープンdoc
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
[bug]: Maximizing the Windows dashboard covers the taskbar対応中かも @xiufengsun が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
xiufengsun/TokenTracker#1152 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug Tests
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
JSPrismarine/JSPrismarine#3384 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
desec-io/desec-stack#1312 ·
メンテナーはふだん 14 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
w3c/csswg-drafts#14848 ·
メンテナーはふだん 1 日以内に返信