#1151837 FTBFS: on riscv64: Can't determine the arch of: 'out/Release/node'

Package:
src:nodejs
Source:
src:nodejs
Submitter:
Aurelien Jarno
Date:
2026-10-28 20:43:02 UTC
Severity:
normal
Tags:
#1151837#5
Date:
2026-10-23 19:25:10 UTC
From:
To:
Dear maintainer,

As you surely have noticed, the latest version of nodejs fails to build
on riscv64. It fails with:

| Clean up any leftover processes but don't error if found.
| ps awwx | grep Release/node | grep -v grep | cat
| Clean up any leftover processes, error if found.
| python3 tools/test.py  -p tap --logfile test.tap \
| 	--mode=release --flaky-tests-mode=dontcare \
| 	--skip-tests=parallel/test-perf-hooks-sliding-window-histogram,parallel/test-process-versions,parallel/test-cli-node-options-docs,parallel/test-config-file,parallel/test-debugger-probe-typescript,parallel/test-util-getcallsites,parallel/test-worker-eval-typescript,parallel/test-node-output-eval,parallel/test-worker-cli-options,parallel/test-worker-load-file-with-extension-other-than-js,parallel/test-node-output-sourcemaps,parallel/test-runner-output,parallel/test-runner-global-setup-teardow,parallel/test-runner-run-global-hooks,parallel/test-compile-cache-typescript-commonjs,parallel/test-compile-cache-typescript-esm,parallel/test-compile-cache-typescript-strip-miss,parallel/test-compile-cache-typescript-strip-sourcemaps,parallel/test-compile-cache-typescript-transform,parallel/test-npm-install,parallel/test-npm-version,parallel/test-release-npm,parallel/test-dns,parallel/test-net-connect-immediate-finish,parallel/test-net-better-error-messages-port-hostname,parallel/test-https-connect-address-family,parallel/test-tls-connect-address-family,parallel/test-dns-cancel-reverse-lookup,parallel/test-dns-resolveany-bad-ancount,parallel/test-child-process-stdio-overlapped,parallel/test-crypto-authenticated,parallel/test-corepack-yarn-install,parallel/test-corepack-version,test/parallel/test-util-styletext,sequential/test-force-repl,sequential/test-performance,sequential/test-watch-mode,sequential/test-watch-mode-inspect,parallel/test-process-uid-gid,parallel/test-process-initgroups,parallel/test-process-setgroups,parallel/test-process-euid-egid,parallel/test-strace-openat-openssl,parallel/test-fs-error-messages,parallel/test-cluster-bind-privileged-port,parallel/test-cluster-shared-handle-bind-privileged-port,parallel/test-debugger-preserve-breaks,parallel/test-debugger-heap-profiler,parallel/test-fs-utimes,parallel/test-fs-utimes-y2K38,parallel/test-debug-args,sequential/test-cpu-prof-dir-absolute,sequential/test-cpu-prof-exit,parallel/test-inspector-esm,parallel/test-sqlite \
| 	--arch=riscv64 --timeout=600 --flaky-tests=parallel/test-runner-output,sequential/test-tls-session-timeout,parallel/test-net-listen-after-destroying-stdin,parallel/test-process-config,parallel/test-regress-GH-746,parallel/test-stdout-close-unref,parallel/test-child-process-stdout-flush-exit,parallel/test-net-connect-options-fd,sequential/test-fs-watch,sequential/test-http2-session-timeout,sequential/test-debugger-preserve-breaks,sequential/test-debugger-exec-scope,sequential/test-worker-heapsnapshot-options,parallel/test-cluster-primary-error,parallel/test-cluster-primary-kill,sequential/test-http-server-keep-alive-timeout-slow-client-headers,parallel/test-icu-env,parallel/test-tls-ocsp-callback,sequential/test-diagnostic-dir-cpu-prof,sequential/test-cpu-prof-default,sequential/test-cpu-prof-worker-argv,sequential/test-cpu-prof-dir-and-name,sequential/test-cpu-prof-exit,sequential/test-cpu-prof-kill,sequential/test-cpu-prof-name,sequential/test-diagnostic-dir-cpu-prof,sequential/test-debugger-auto-resume,sequential/test-debugger-preserve-breaks,sequential/test-cpu-prof-dir-relative,sequential/test-cpu-prof-drained,sequential/test-worker-prof,sequential/test-vm-timeout-escape-promise-module-2,sequential/test-cpu-prof-dir-absolute,parallel/test-fetch,parallel/test-net-socket-connect-without-cb,parallel/test-runner-inspect,parallel/test-runner-output,parallel/test-tcp-wrap-listen,parallel/test-wasm-web-api,parallel/test-vm-timeout-escape-promise-module,parallel/test-crypto-sign-verify,parallel/test-freeze-intrinsics,parallel/test-repl-paste-big-data,parallel/test-snapshot-reproducible,parallel/test-tls-root-certificates,parallel/test-vm-global-non-writable-properties,parallel/test-vm-global-setter,parallel/test-vm-module-synthetic,parallel/test-vm-strict-assign,parallel/test-child-process-spawn-typeerror --shell=out/Release/node message parallel sequential
| Can't determine the arch of: 'out/Release/node'
|
| No tests to run.
| make[2]: *** [Makefile:591: test-ci-js] Error 1
| make[2]: Leaving directory '/tmp/tmp.qssLWQ2SLR.nodejs'
| make[1]: *** [debian/rules:425: override_dh_auto_test-arch] Error 1
| make[1]: Leaving directory '/build/reproducible-path/nodejs-24.22.0+dfsg+~cs24.19.2'
| make: *** [debian/rules:348: binary-arch] Error 2
| dpkg-buildpackage: error: debian/rules binary-arch subprocess failed with exit status 2

The full build log is available here:
https://buildd.debian.org/status/fetch.php?pkg=nodejs&arch=riscv64&ver=24.22.0%2Bdfsg%2B%7Ecs24.19.2-2&stamp=1792612093&raw=0

After investigation, it appears that version 24.22.0+dfsg+~cs24.19.2-2
just segfaults on start:

| $ gdb out/Release/node
| GNU gdb (Debian 18.1-3) 18.1
| Copyright (C) 2026 Free Software Foundation, Inc.
| License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
| This is free software: you are free to change and redistribute it.
| There is NO WARRANTY, to the extent permitted by law.
| Type "show copying" and "show warranty" for details.
| This GDB was configured as "riscv64-linux-gnu".
| Type "show configuration" for configuration details.
| For bug reporting instructions, please see:
| <https://www.gnu.org/software/gdb/bugs/>.
|
| +------------------------------------------------------------------------------+
| | Find the GDB manual online at:                                               |
| | http://www.gnu.org/software/gdb/documentation/.                              |
| | For help, type "help".                                                       |
| | Type "apropos word" to search for commands related to "word".                |
| +------------------------------------------------------------------------------+
|
| Reading symbols from out/Release/node...
| (gdb) run
| Starting program: /home/aurel32/nodejs/nodejs-24.22.0+dfsg+~cs24.19.2/out/Release/node
| [Thread debugging using libthread_db enabled]
| Using host libthread_db library "/usr/lib/riscv64-linux-gnu/libthread_db.so.1".
| bt
| [New Thread 0x3ff0dcff80 (LWP 454149) (id 2)]
| [New Thread 0x3febffef80 (LWP 454150) (id 3)]
| [New Thread 0x3feb7fdf80 (LWP 454151) (id 4)]
| [New Thread 0x3feaffcf80 (LWP 454152) (id 5)]
| [New Thread 0x3fea7fbf80 (LWP 454153) (id 6)]
| [New Thread 0x3ff04fef80 (LWP 454154) (id 7)]
|
| Thread 1 "MainThread" received signal SIGSEGV, Segmentation fault.
| 0x0000003ff5467fb6 in std::__atomic_base<long>::load (this=0x20000001f, __m=std::memory_order::relaxed) at /usr/include/c++/16/bits/atomic_base.h:529
| 529             return __atomic_load_n(&_M_i, int(__m));
| (gdb) bt
| #0  0x0000003ff5467fb6 in std::__atomic_base<long>::load (this=0x20000001f, __m=std::memory_order::relaxed) at /usr/include/c++/16/bits/atomic_base.h:529
| #1  std::atomic_load_explicit<long> (__a=0x20000001f, __m=std::memory_order::relaxed) at /usr/include/c++/16/atomic:1372
| #2  v8::base::Relaxed_Load (ptr=0x20000001f) at ../deps/v8/src/base/atomicops.h:347
| #3  v8::base::AsAtomicImpl<long>::Relaxed_Load<unsigned long> (addr=0x20000001f) at ../deps/v8/src/base/atomic-utils.h:87
| #4  v8::internal::TaggedField<v8::internal::SharedFunctionInfo, 32, v8::internal::V8HeapCompressionSchemeImpl<v8::internal::MainCage> >::Relaxed_Load (cage_base=..., host=..., offset=0) at ../deps/v8/src/objects/tagged-field-inl.h:272
| #5  v8::internal::JSFunction::shared (this=<optimized out>, cage_base=...) at ../deps/v8/src/objects/js-function-inl.h:252
| #6  v8::internal::JSFunction::shared (this=<optimized out>, cage_base=...) at ../deps/v8/src/objects/js-function-inl.h:247
| #7  v8::internal::JSFunction::shared (this=<optimized out>) at ../deps/v8/src/objects/js-function-inl.h:246
| #8  v8::internal::__RT_impl_Runtime_InstallBaselineCode (args=..., isolate=0x2aaab82000) at ../deps/v8/src/runtime/runtime-compiler.cc:91
| #9  v8::internal::Runtime_InstallBaselineCode (args_length=1, args_object=0x3fffffe398, isolate=0x2aaab82000) at ../deps/v8/src/runtime/runtime-compiler.cc:87
| #10 0x0000003ff4b12364 in Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit () from /home/aurel32/nodejs/nodejs-24.22.0+dfsg+~cs24.19.2/out/Release/libnode.so.137
| Backtrace stopped: frame did not save the PC
| (gdb)

I have rebuilt version 24.21.0+dfsg+~cs24.13.4-1 in the same
environment, and it works fine, so the issue is not due to a dependency.

I have also been able to reproduce the issue with upstream tag v24.22.0
as well as v24.22.1. On the other hand upstream tag v24.21.0 works fine,
so the issue is not due to a debian change.

I have started bisecting, but it will take some time.

Regards
Aurelien

#1151837#10
Date:
2026-10-24 09:24:38 UTC
From:
To:
...

Here is the result:

| fb0d0ca28993802d67360edc84d467fe3ccdc20b is the first 'bad' commit
| commit fb0d0ca28993802d67360edc84d467fe3ccdc20b (HEAD)
| Author: Ruan Gustavo <dev.ruangustavo@gmail.com>
| Date:   Wed Sep 2 22:00:20 2026 -0300
| 
|     deps: V8: backport 0b94a9fd23ba
| 
|     Original commit message:
| 
|         [leaptiering] Fix BaselineOutOfLinePrologue builtin
| 
|         ... which tried to preserve kJavaScriptCallDispatchHandleRegister even
|         on configurations where it's not used which resulted in a random value
|         on the stack discoverable by GC.
|         This issue triggered only on non-sandbox configuration with enabled
|         leaptiering.
| 
|         Drive-by: fix MacroAssembler::GenerateTailCallToReturnedCode() on riscv
|         port which wasn't preserving dispatch handle as all the other ports do.
| 
|         Bug: 42204201
|         Fixed: 413769394
| 
|         Change-Id: If146b0b7a6cf972ed5a881142f40980774f19cba
|         Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6587010
|         Commit-Queue: Igor Sheludko <ishell@chromium.org>
|         Reviewed-by: Olivier Flückiger <olivf@chromium.org>
|         Cr-Commit-Position: refs/heads/main@{#100512}
| 
|     Node.js 24 builds V8 with leaptiering enabled and the sandbox disabled,
|     so V8_JS_LINKAGE_INCLUDES_DISPATCH_HANDLE is not defined and the JS
|     calling convention does not carry the dispatch handle register (x4 on
|     arm64). BaselineOutOfLinePrologue and GenerateTailCallToReturnedCode
|     still pushed that register as a tagged slot of an INTERNAL frame, so
|     whatever value the caller left there is dereferenced by
|     ClearStaleLeftTrimmedPointerVisitor during mark-compact root scanning
|     and crashes the process with SIGSEGV (seen as jest workers dying).
| 
|     Refs: https://github.com/v8/v8/commit/0b94a9fd23ba5f59b3f675fb04d60a9b0102e27d
|     Fixes: https://github.com/nodejs/node/issues/62393
|     PR-URL: https://github.com/nodejs/node/pull/65753
|     Reviewed-By: Richard Lau <richard.lau@ibm.com>
| 
|  common.gypi                                            |  2 +-
|  deps/v8/src/builtins/arm64/builtins-arm64.cc           |  3 ++-
|  deps/v8/src/builtins/loong64/builtins-loong64.cc       |  5 +++--
|  deps/v8/src/builtins/mips64/builtins-mips64.cc         |  5 +++--
|  deps/v8/src/builtins/riscv/builtins-riscv.cc           |  7 +++++--
|  deps/v8/src/builtins/x64/builtins-x64.cc               |  5 +++--
|  deps/v8/src/codegen/arm64/macro-assembler-arm64.cc     | 11 ++++++-----
|  deps/v8/src/codegen/loong64/macro-assembler-loong64.cc |  5 +++--
|  deps/v8/src/codegen/mips64/macro-assembler-mips64.cc   |  5 +++--
|  deps/v8/src/codegen/riscv/macro-assembler-riscv.cc     | 18 +++++++++++++++---
|  deps/v8/src/codegen/x64/macro-assembler-x64.cc         |  5 +++--
|  11 files changed, 47 insertions(+), 24 deletions(-)

I have tested that reverting that commit on upstream v24.22.1 or on the
Debian package fix the issue. I still need to understand what is broken,
any help is welcome.

Regards
Aurelien

#1151837#15
Date:
2026-10-26 22:47:07 UTC
From:
To:
Hi,
https://chromium.googlesource.com/v8/v8.git/+/ec2f506f97dfbb5fa19e4fe9103965a3c94690af

Backporting it to the embedded v8 copy fixes the issue.

Regards
Aurelien

#1151837#20
Date:
2026-10-27 20:00:51 UTC
From:
To:
control: forwarded -1 https://github.com/nodejs/node/issues/67066

Hi,
https://github.com/nodejs/node/issues/67066

Regards
Aurelien

#1151837#27
Date:
2026-10-28 20:41:18 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
nodejs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1151837@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jérémy Lal <kapouer@melix.org> (supplier of updated nodejs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 28 Oct 2026 20:57:23 +0100
Source: nodejs
Architecture: source
Version: 24.22.2+dfsg+~cs24.19.2-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@alioth-lists.debian.net>
Changed-By: Jérémy Lal <kapouer@melix.org>
Closes: 1151837
Changes:
 nodejs (24.22.2+dfsg+~cs24.19.2-1) unstable; urgency=medium
 .
   * New upstream version 24.22.2+dfsg+~cs24.19.2
   * riscv64: add missing v8 patch. Closes: #1151837.
     Thanks to Aurelien Jarno.
Checksums-Sha1:
 1cd2ad1db7da8b9aae91633b87c76e3ae37b71f3 4566 nodejs_24.22.2+dfsg+~cs24.19.2-1.dsc
 1a424c8ff105c6d0aa093f26d429345e0db5c7f8 349764 nodejs_24.22.2+dfsg+~cs24.19.2.orig-types-node.tar.xz
 b3626504add6cd758ad9c4467198650809337078 24124964 nodejs_24.22.2+dfsg+~cs24.19.2.orig.tar.xz
 14599a9e86d2baedf54af79f576cb61f1636c0dd 167728 nodejs_24.22.2+dfsg+~cs24.19.2-1.debian.tar.xz
 d60de2e30e040ffb141e1fe398497ba36a18e698 11992 nodejs_24.22.2+dfsg+~cs24.19.2-1_source.buildinfo
Checksums-Sha256:
 480882bb1504e6cb8fec1036e84f9b0bc94db42cc93db3404ce353fb0277c809 4566 nodejs_24.22.2+dfsg+~cs24.19.2-1.dsc
 910d827a0f8bffdd516875a76572eb53c9616dcbd458e61fa26d00f65d4bd5db 349764 nodejs_24.22.2+dfsg+~cs24.19.2.orig-types-node.tar.xz
 669068e74805896e150a437417c6783e770f310f082e5f1088be30be4cb47bab 24124964 nodejs_24.22.2+dfsg+~cs24.19.2.orig.tar.xz
 ec6fedcc9023e49f3315a797b2aef9b2ac7772cc24ec0ea8c9a986a34b0c7311 167728 nodejs_24.22.2+dfsg+~cs24.19.2-1.debian.tar.xz
 d65cc9b654354880370959990495ec899298cd9be2db389f36168c91ccdf5602 11992 nodejs_24.22.2+dfsg+~cs24.19.2-1_source.buildinfo
Files:
 9c2aa36894f2af4519a10b84de74b858 4566 javascript optional nodejs_24.22.2+dfsg+~cs24.19.2-1.dsc
 1de80f97a87b51f555f40a56a60025d4 349764 javascript optional nodejs_24.22.2+dfsg+~cs24.19.2.orig-types-node.tar.xz
 d93dee2d9e8dad3b9d2fc44c321318da 24124964 javascript optional nodejs_24.22.2+dfsg+~cs24.19.2.orig.tar.xz
 7edfc535fa603ec0dc9f06040f8d2c2c 167728 javascript optional nodejs_24.22.2+dfsg+~cs24.19.2-1.debian.tar.xz
 ce810cd9bdb7a2aecc792a02853dacff 11992 javascript optional nodejs_24.22.2+dfsg+~cs24.19.2-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCAAtFiEEA8Tnq7iA9SQwbkgVZhHAXt0583QFAmriU74PHGplcnJ5QGVk
YS5zYXJsAAoJEGYRwF7dOfN0KX0QAMb3JM3ul1FH4MeUsly/blMVB94W54MTkK1T
IzJHUrxQ6eGoJ/JAkRIl23Yl9yY6oa+NELwFhKf7a0V7Xa6Q8n19TKLIFJwYVMyu
owxt7K+UFWHGzvIBsmcXgDvenrBGbVz6+dBbDZBZPXpSbdXhy/6u5AeyA8H36zj2
cztnj5oILthqZ7IF9NI0gSpp7mPAQGAwp12rZu4I++GLVTyX3gon4b0SVVEyNoXw
zpj4E9A2NDE85WPnalVZG1WR7JjhuTFXO5UhBUzdQ5Hcwnu/CFeBa2a/ZGbGQ1EM
hfM72lmdSvC+g8d9pGk/iqaiaspJGwylZP7U81BpiWNFHZR/to4RjunWwGIoQyrT
QeyrsNBFXXu8VQa6qxgnKGedU14OCsP3WIq57JwVpRa/A25dv4T2pjMBrbqS2jiM
neHTbt2cNeYMU4+2M8Zsqh3T/9TZXxPgyLeySCFmLVzSp+Tgv3oMGmJ70bClN9Jt
CrYOBi801IWplDGqdVf42W7ybP+4042Q1dvBImTkPIAETZrKYC3UZBgHesTR2Zbn
TUmCME9DKRWRgoGDEgFbZ9NRg1iON51e52WVrHgOCfs5AIV4LImOfDMgl6h6UXaj
sDheVoPyuYI8XSK+NFMPXD5W8qIfRvKR9bQFS1F3vhkBLpFr5TuLgUXPg5vyS/3Z
zWQlvwLh
=Rrdq
-----END PGP SIGNATURE-----