Skip to content

[Regression] V8 crashed while building AdGuard Home with webpack #9

Closed
@kxxt

Description

@kxxt

A regression is found in nodejs 24.2.0 packaged by archriscv.

Crash output on SG2042(Sv39):

> dashboard@0.1.0 build-prod
> cross-env BUILD_ENV=prod webpack --config webpack.prod.js

(node:1219) [DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_HASH] DeprecationWarning: [hash] is now [fullhash] (also consider using [chunkhash] or [contenthash], see documentation for details)
(Use `node --trace-deprecation ...` to show where the warning was created)


#
# Fatal error in , line 0
# Check failed: (trampoline_pos - fixup_pos) <= kMaxBranchOffset.
#
#
#
#FailureMessage Object: 0x3f777fc4f0
----- Native stack trace -----

 1: 0x2ae7723152  [webpack]
 2: 0x2ae87f2a70 V8_Fatal(char const*, ...) [webpack]
 3: 0x2ae81ad480 v8::internal::Assembler::bind_to(v8::internal::Label*, int) [webpack]
 4: 0x2ae8cdccde v8::internal::compiler::CodeGenerator::AssembleDeoptimizerCall(v8::internal::compiler::DeoptimizationExit*) [webpack]
 5: 0x2ae8cdd5b2 v8::internal::compiler::CodeGenerator::AssembleCode() [webpack]
 6: 0x2ae894727c _ZN2v88internal8compiler10turboshaft8Pipeline3RunITkNS2_15TurboshaftPhaseENS2_17AssembleCodePhaseEJEEEDaDpOT0_ [webpack]
 7: 0x2ae892fa06 v8::internal::compiler::turboshaft::Pipeline::AssembleCode(v8::internal::compiler::Linkage*) [webpack]
 8: 0x2ae8922068  [webpack]
 9: 0x2ae89211e6 v8::internal::compiler::PipelineCompilationJob::ExecuteJobImpl(v8::internal::RuntimeCallStats*, v8::internal::LocalIsolate*) [webpack]
10: 0x2ae793737e v8::internal::OptimizedCompilationJob::ExecuteJob(v8::internal::RuntimeCallStats*, v8::internal::LocalIsolate*) [webpack]
11: 0x2ae7973716 v8::internal::OptimizingCompileTaskExecutor::CompileTask::RunCompilationJob(v8::internal::Isolate*, v8::internal::LocalIsolate&, v8::internal::TurbofanCompilationJob*) [webpack]
12: 0x2ae797336e v8::internal::OptimizingCompileTaskExecutor::CompileTask::Run(v8::JobDelegate*) [webpack]
13: 0x2ae85b85a0 v8::platform::DefaultJobWorker::Run() [webpack]
14: 0x2ae77202a6  [webpack]
15: 0x3f7f4fb030  [/usr/lib/libc.so.6]
16: 0x3f7f5502b8  [/usr/lib/libc.so.6]
==> ERROR: A failure occurred in build().

Build passes on Qemu-user(Sv48).

Node.js 22.16.0 failed on SG2042(Sv39) but did not crash(I think this is the expected behavior):

> dashboard@0.1.0 build-prod
> cross-env BUILD_ENV=prod webpack --config webpack.prod.js

(node:1188) [DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_HASH] DeprecationWarning: [hash] is now [fullhash] (also consider using [chunkhash] or [contenthash], see documentation for details)
(Use `node --trace-deprecation ...` to show where the warning was created)
node:internal/deps/undici/undici:5829
      return await WebAssembly.instantiate(mod, {
                               ^

RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance
    at lazyllhttp (node:internal/deps/undici/undici:5829:32)

Node.js v22.16.0
==> ERROR: A failure occurred in build().

More test results:

Product V8 Version Version Node.js Vendor Environment Compiler Test Result
Node.js 13.6.10.223 24.2.0 ArchRV SG2042 Sv39 Clang 20 CRASH!!!
Node.js 13.6.10.223 24.2.0 ArchRV Qemu-user Sv48 Clang 20 PASS
Node.js 12.4.21.254 22.16.0 ArchRV SG2042 Sv39 GCC Fail
Node.js 12.4.21.254 22.16.0 ArchRV Qemu-user Sv48 GCC PASS
Node.js 12.9.28.202 23.9.0 ArchRV SG2042 Sv39 Clang 19.1.7-2 Fail
Node.js 12.9.28.202 23.9.0 ArchRV Qemu-user Sv48 Clang 19.1.7-2 N/A
Electron 13.4.114.21 35.5.1 22.15.1 riscv-forks SG2042 Sv39 Chromium Clang 20 PASS
Electron 13.6.233.11 36.4.0 22.15.1 riscv-forks SG2042 Sv39 Chromium Clang 21 PASS
Electron 13.6.233.8 36.2.1 22.15.0 ArchRV SG2042 Sv39 Clang 19.1.7-2 PASS

Notably, Elecron 36.4.0 uses a v8 version close to what node.js 24 is using, but it does not crash, and it even finished the build without encountering wasm Out of memory error.

It is difficult to locate the culprit component because we only have one CRASH case.
It might be V8, nodejs 24 or even clang 20.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions