Title: riscv64: every script segfaults in Runtime_InstallBaselineCode since v24.22.0 (backport of V8 0b94a9fd23ba dropped the runtime argument) · Issue #67655 · nodejs/node · GitHub
Open Graph Title: riscv64: every script segfaults in Runtime_InstallBaselineCode since v24.22.0 (backport of V8 0b94a9fd23ba dropped the runtime argument) · Issue #67655 · nodejs/node
X Title: riscv64: every script segfaults in Runtime_InstallBaselineCode since v24.22.0 (backport of V8 0b94a9fd23ba dropped the runtime argument) · Issue #67655 · nodejs/node
Description: 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...
Open Graph Description: 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, `./co...
X Description: 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, `./co...
Opengraph URL: https://github.com/nodejs/node/issues/67655
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"riscv64: every script segfaults in Runtime_InstallBaselineCode since v24.22.0 (backport of V8 0b94a9fd23ba dropped the runtime argument)","articleBody":"### Version\n\nv24.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.\n\n### Platform\n\n```text\nLinux 6.18 riscv64 (SpacemiT K3), Ubuntu 26.04, gcc 15.2, `./configure --openssl-no-asm`\n```\n\n### Subsystem\n\ndeps (V8, riscv64 port)\n\n### What steps will reproduce the bug?\n\nBuild v24.22.1 natively on riscv64 and run any script:\n\n```\n$ out/Release/node --version\nv24.22.1\n$ out/Release/node -p 1+1\nSegmentation fault (core dumped)\n```\n\n`--no-sparkplug` and `--jitless` both avoid it.\n\n### How often does it reproduce? Is there a required condition?\n\nAlways, on the first function that takes the baseline path.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`2`\n\n### What do you see instead?\n\n```\nThread 1 \"MainThread\" received signal SIGSEGV, Segmentation fault.\n#0 v8::internal::Runtime_InstallBaselineCode(int, unsigned long*, v8::internal::Isolate*) ()\n#1 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit ()\n```\n\n### Additional information\n\n#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.\n\n`main` pushes the function separately before the call, so only the backport is affected. Restoring the register fixes it:\n\n```diff\n--- a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc\n+++ b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc\n@@ -202,7 +202,7 @@\n Push(kJavaScriptCallDispatchHandleRegister);\n #endif\n Push(kJavaScriptCallTargetRegister, kJavaScriptCallNewTargetRegister,\n- kJavaScriptCallArgCountRegister);\n+ kJavaScriptCallArgCountRegister, kJavaScriptCallTargetRegister);\n \n CallRuntime(function_id, 1);\n // Use the return value before restoring a0\n```\n\nWith 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.\n","author":{"url":"https://github.com/wbar","@type":"Person","name":"wbar"},"datePublished":"2026-11-20T13:28:30Z","url":"https://github.com/nodejs/node/issues/67655"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a0c4a543-770d-3212-368f-e100e3e3183d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C39A:32CBBB:3ABD73:4CFA9D:6B06199B |
| html-safe-nonce | 9870a724807adc88001a3dfdb0b209a83b72efe33e76b0ea3986f04b2c1c7f38 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzlBOjMyQ0JCQjozQUJENzM6NENGQTlEOjZCMDYxOTlCIiwidmlzaXRvcl9pZCI6IjM1NDE4MDY2MTYzNDI3NTczOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 01182528515e83625fc54baaae3d752a83a7ce124bc1ef626180c0fd5acf9077 |
| hovercard-subject-tag | issue:6512359352 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67655/issue_layout |
| twitter:image | https://opengraph.githubassets.com/262eb7d9c990b5890b8e9867f79584f78eb77d92a74afaab8702153839bceeb1/nodejs/node/issues/67655 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/262eb7d9c990b5890b8e9867f79584f78eb77d92a74afaab8702153839bceeb1/nodejs/node/issues/67655 |
| og:image:alt | 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, `./co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wbar |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width