Skip to content

riscv64 (SpacemiT X100): v24 segfaults in Runtime_InstallBaselineCode (Sparkplug), and Wasm SIMD (RVV) breaks fetch #67940

Backlog

Description

@beenhero

Two separate problems with Node.js v24 on a RISC-V 64 core with the V extension. Both look like V8 riscv64 issues; could the maintainers route them to V8 as needed? Node v22 (V8 12.4) on the same machine runs both repros fine.

Environment

  • CPU: SpacemiT X100 (rv64gcv, Zba/Zbb/Zbs, sv39 MMU)
  • Kernel: Linux 6.18.3; distro glibc 2.43; gcc 15.2.0
  • Node: v24.22.3 (V8 13.6.x)
    • the unofficial-builds node-v24.22.3-linux-riscv64.tar.xz (checksum matches its SHASUMS256.txt), and
    • a native build of the official, signature-verified node-v24.22.3.tar.xz with the default ./configure (leaptiering on, pointer compression off).
  • Control: Node v22.22.1 (distro package) on the same machine has neither problem.

Bug 1: any JavaScript segfaults (Sparkplug baseline code)

Repro

$ node -e 1
Segmentation fault (exit 139)

Flag matrix (both binaries)

  • Runs (exit 0): --jitless, --no-sparkplug, --always-sparkplug.
  • Still crashes: default, --no-opt, --max-lazy, --no-baseline-batch-compilation (also with batch compilation compiled off by default), --no-concurrent-sparkplug, --single-threaded, --short-builtin-calls, --no-short-builtin-calls, --riscv-b-extension, --no-riscv-b-extension, --riscv-c-extension, --no-riscv-c-extension, --no-riscv-constant-pool, --sparkplug --no-lazy-feedback-allocation.

Crash site

Captured with a SIGSEGV handler (gdb unavailable). On the native build, which is not stripped:

  • pc in v8::internal::Runtime_InstallBaselineCode(int, unsigned long*, v8::internal::Isolate*);
  • ra in Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit;
  • fault address 0x20000001f on both binaries. That reads as Smi 2 (0x200000000, 32-bit-shifted Smi with pointer compression off) dereferenced as a HeapObject at field offset +0x1f. So the runtime function appears to receive a Smi where args[0] should be the JSFunction.

Things ruled out

  • Zba/Zbb/Zbs codegen: hiding Zba/Zbb/Zbs from V8 by masking riscv_hwprobe results (V8 then reports zba=0, zbb=0, zbs=0) still crashes.
  • Leaptiering could not be isolated: building with v8_enable_leaptiering=0 for riscv64 doesn't compile:
    deps/v8/src/codegen/riscv/macro-assembler-riscv.cc:276:57: error: 'temps' was not declared in this scope
    
    It's in the #ifndef V8_ENABLE_LEAPTIERING tiering path: temps is declared inside the preceding block, but TailCallOptimizedCodeSlot(..., temps.Acquire(), temps.Acquire()) uses it after the block closes.

Bug 2: global fetch fails; WebAssembly SIMD (RVV) gives wrong results

Repro (with --no-sparkplug to get past bug 1)

$ node --no-sparkplug -e 'fetch("https://registry.npmjs.org/-/ping").then(r=>console.log(r.status)).catch(e=>console.log(String(e.cause)))'
HTTPParserError: Response does not match the HTTP/1.1 protocol (Invalid header value char)

Node v22 prints 200.

  • Unchanged with --no-liftoff or --no-wasm-tier-up.
  • Works (200) with:
    • undici forced onto its non-SIMD llhttp Wasm module;
    • the V extension (RISCV_HWPROBE_IMA_V) masked from V8 via riscv_hwprobe;
    • a native build with RISCV_SIMD cleared in CpuFeatures::ProbeImpl (WebAssembly.validate() of a SIMD module then returns false). 3 of 3 runs returned 200.

So V8's RVV lowering of Wasm SIMD128 appears to produce wrong results on this core, exercised by llhttp's SIMD parser.


Not checked

  • Newer V8 versions.
  • A V8 debug build under gdb.
  • Other RVV 1.0 cores, which would tell a core erratum apart from a V8 bug.

I'm happy to run test builds or patches on this hardware.

Activity

  1. Renegade334 commented on Dec 1, 2026

    @Renegade334
    Member

    Bug 1: any JavaScript segfaults (Sparkplug baseline code)

    This half is a duplicate of #67655, it looks like the unofficial builds for v24.23.0 are still cooking, so suggest you re-test once these are published.

  2. added
    riscv64
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    riscv64

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions