You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
riscv64: every script segfaults in Runtime_InstallBaselineCode since v24.22.0 (backport of V8 0b94a9fd23ba dropped the runtime argument) #67655
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.
Independent confirmation on SpacemiT K3 (X100), Ubuntu 26.04.1, gcc 15.2.0, glibc 2.43 — plus test results for the fix in #67430 (landed as b3c5918 on v24.x-staging).
Affected binaries
node-v24.22.3-linux-riscv64.tar.xz from unofficial-builds (sha256 9c8c8df394272c2ad69becb08c1e2028b271cd35b450ed98ca3c67c1fa1c68d0): node --version works, but node -e "" and node -p 1 segfault every time (exit 139). --no-lazy, --no-use-osr and --single-threaded do not help; only --no-sparkplug (and --jitless) avoid it.
Native build of the v24.22.3 source tarball (default ./configure, only --prefix set): identical crash. gdb: SIGSEGV at Runtime_InstallBaselineCode+52 (ld a2,0(a4), a4 = 0x30000001f) with argv[0] = 0x300000000 = Smi(3) = the JS argument count — the runtime function receives the argc slot as its function argument, exactly as analysed above.
With the one-line fix
Cherry-pick of ec2f506f97df, i.e. Push(kJavaScriptCallTargetRegister); before CallRuntime(function_id, 1), applied to the same native build:
startup, hot loops, WebAssembly, async/timers, --always-sparkplug and --maglev stress: all pass;
tools/test.py on a 495-file subset of test/parallel (vm, timer, promise, fs-read, wasm, worker, http-client, http-server): 496 passed, 0 failed;
a large tsx-based service has been running on it since without issues.
Not affected
Node v26.9.0 riscv64 (V8 14.6.202.34-node.32) runs the same scripts fine on the same board.
So the cherry-pick is confirmed sufficient on K3 hardware as well — looking forward to v24.23.0.
Activity
sxa commentedon Nov 20, 2026
Ref: nodejs/unofficial-builds#253
HougeLangley commentedon Nov 24, 2026
Independent confirmation on SpacemiT K3 (X100), Ubuntu 26.04.1, gcc 15.2.0, glibc 2.43 — plus test results for the fix in #67430 (landed as b3c5918 on
v24.x-staging).Affected binaries
node-v24.22.3-linux-riscv64.tar.xzfrom unofficial-builds (sha2569c8c8df394272c2ad69becb08c1e2028b271cd35b450ed98ca3c67c1fa1c68d0):node --versionworks, butnode -e ""andnode -p 1segfault every time (exit 139).--no-lazy,--no-use-osrand--single-threadeddo not help; only--no-sparkplug(and--jitless) avoid it../configure, only--prefixset): identical crash. gdb: SIGSEGV atRuntime_InstallBaselineCode+52(ld a2,0(a4),a4 = 0x30000001f) withargv[0] = 0x300000000= Smi(3) = the JS argument count — the runtime function receives the argc slot as itsfunctionargument, exactly as analysed above.With the one-line fix
Cherry-pick of
ec2f506f97df, i.e.Push(kJavaScriptCallTargetRegister);beforeCallRuntime(function_id, 1), applied to the same native build:--always-sparkplugand--maglevstress: all pass;tools/test.pyon a 495-file subset oftest/parallel(vm, timer, promise, fs-read, wasm, worker, http-client, http-server): 496 passed, 0 failed;tsx-based service has been running on it since without issues.Not affected
Node v26.9.0 riscv64 (V8
14.6.202.34-node.32) runs the same scripts fine on the same board.So the cherry-pick is confirmed sufficient on K3 hardware as well — looking forward to v24.23.0.