#1144759 nodejs: testsuite fails on RISC-V hardware with vector extension

Package:
src:nodejs
Source:
src:nodejs
Submitter:
Aurelien Jarno
Date:
2026-08-22 21:57:03 UTC
Severity:
normal
Tags:
#1144759#5
Date:
2026-08-18 20:08:21 UTC
From:
To:
Dear maintainers,

Two of the riscv64 buildds (rv-manda-02 and rv-manda-04) recently got
their hardware upgraded to a CPU with vector extension ("V"). nodejs, or
rather v8, is able to use the corresponding instructions at runtime.
Unfortunately support for this extension seems to be broken, causing a
few testsuite failures and thus the package to FTBFS:

| out/Release/node --inspect=0 --experimental-network-inspection /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-inspector-network-content-type.js
| out/Release/node --inspect=0 --experimental-network-inspection --expose-internals /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-inspector-network-fetch.js
| out/Release/node /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-performance-many-marks.js
| out/Release/node --expose-internals /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-http2-allow-http1-upgrade-ws.js
| out/Release/node /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-stream2-read-sync-stack.js
| out/Release/node /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-tick-processor-arguments.js
| out/Release/node --no-use-system-ca /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-tls-set-default-ca-certificates-append-fetch.mjs
| out/Release/node --no-use-system-ca /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-tls-set-default-ca-certificates-reset-fetch.mjs
| out/Release/node /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-worker-resource-limits.js
| out/Release/node /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-inspector-invalid-protocol.js
| out/Release/node --inspect=0 --experimental-network-inspection /tmp/tmp.KAMdCPQ1dV.nodejs/test/parallel/test-inspector-network-websocket.js

The full build log is available there:
https://buildd.debian.org/status/fetch.php?pkg=nodejs&arch=riscv64&ver=24.19.0%2Bdfsg%2B%7Ecs24.13.3-1&stamp=1786593705&raw=0

I am not sure how to debug that, and there might be some fixes already
in the upstream v8. Until a fix is found, it is probably better to
disable vector instructions in the Debian package. I have successfully
tested the following patch on similar hardware:
--- nodejs-24.19.0+dfsg+~cs24.13.3.orig/deps/v8/src/base/cpu.cc
+++ nodejs-24.19.0+dfsg+~cs24.13.3/deps/v8/src/base/cpu.cc
@@ -968,7 +968,7 @@ CPU::CPU()
   if (!syscall(__NR_riscv_hwprobe, &pairs,
                sizeof(pairs) / sizeof(riscv_hwprobe), 0, nullptr, 0)) {
     if (pairs[0].value & RISCV_HWPROBE_IMA_V) {
-      has_rvv_ = true;
+      /* has_rvv_ = true; */
     }
     if (pairs[0].value & RISCV_HWPROBE_IMA_FD) {
       has_fpu_ = true;

This also means that the ZBA, ZBB and ZBS extensions work fine, at least
enough to get the testsuite passing.

Regards
Aurelien

#1144759#10
Date:
2026-08-22 21:55:42 UTC
From:
To:
Hi,

Another data point, the problem is reproducible with VLEN=256, but not
with VLEN=128 (the default in QEMU). It seems that v8 use the vector
extension to emulate either 128, 256 or 512 bit SIMD depending on VLEN
(higher VLEN values are unsupported).

Regards
Aurelien