riscv64: every script segfaults in Runtime_InstallBaselineCode since v24.22.0 (backport of V8 0b94a9fd23ba dropped the runtime argument)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, cpp, javascript
- Ambito
- backend, operating-systems
Direzione di ricerca
Inizia con il backport di V8 in #65753 ed esamina deps/v8/src/codegen/riscv/macro-assembler-riscv.cc, in particolare MacroAssembler::GenerateTailCallToReturnedCode. Confronta le sue istruzioni di push dei registri con v24.21.0 e main, poi compila ed esegui out/Release/node -p 1+1 su riscv64. Il lavoro è completato quando il comando stampa 2 senza un segmentation fault.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- JavaScript
- Stelle
- 124k
- Fork
- 38.1k
- Merge medio
- 4g 21h
- PR unite (30g)
- 242
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nodejs/node
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nodejs/node#67643 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
util: parseArgs() treats a `-` inside a short option group as the `--` terminatorForse già presa @yohannesjoya l’ha presa 17 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
util.parseEnv and --env-file keep a leading UTF-8 BOM in the first keyForse già presa @helmipradita l’ha presa 21 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
node:internal/inspector/network_http: `TypeError: Missing dataLength` in event when response uses `setEncoding()`Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nodejs/node#66551 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Stream.prototype.forEach will block in first promise in queue before read more chunkForse già presa @mmustafasenoglu l’ha presa 56 giorni fa. Apertadoc
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
marketing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[bug]: Maximizing the Windows dashboard covers the taskbarForse già presa @xiufengsun l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
xiufengsun/TokenTracker#1152 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
parity: scripting.net's net-http row fails on macOS with errno 61 where the BDS golden has 111ApertaBug Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
JSPrismarine/JSPrismarine#3384 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
desec-io/desec-stack#1312 ·
I maintainer di solito rispondono entro 14 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
w3c/csswg-drafts#14848 ·
I maintainer di solito rispondono entro 1 giorno