Skip to content

SEA blob built with Node.js 22.20.0 cause Node.js to crash #60327

@bzp2010

Description

@bzp2010

Version

22.20.0 LTS

Platform

Linux host 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Microsoft Windows NT 10.0.26200.0 x64

Darwin Mac-mini.local 25.0.0 Darwin Kernel Version 25.0.0: Wed Sep 17 21:42:08 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8132 arm64

Subsystem

SEA, Single executable applications

What steps will reproduce the bug?

I've noticed that the SEA module in Node.js 22.20.0 generates corrupted blob files. Subsequently, regardless of which Node.js version this file is inlined into (I've tested 20.15.0, 22.17.0, 22.18.0, and 22.20.0), it causes crashes.

Conversely, if I generate the blob file using Node.js 22.17.0, the error does not occur when inlined into 22.17.0 or any higher version (even 22.20.0). Therefore, I suspect that from 22.18.0 to 22.20.0 introduced some unknown bug that breaks the SEA build functionality.

Here is a reference build workflow.

https://github.com/api7/adc/blob/main/.github/workflows/release.yaml

It had been working fine previously (I always insisted on installing Node.js LTS back then). Until today, when I tried to release a new version, it started building broken inline files (Node.js binary + SEA blob).

Error logs on Linux amd64:

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal
----- Native stack trace -----

 1: 0xe15f09 node::OnFatalError(char const*, char const*) [adc]
 2: 0x11e03d6 v8::Utils::ReportApiFailure(char const*, char const*) [adc]
 3: 0x10307fa node::sea::LoadSingleExecutableApplication(node::StartExecutionCallbackInfo const&) [adc]
 4: 0x10342bd std::_Function_handler<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&), v8::MaybeLocal<v8::Value> (*)(node::StartExecutionCallbackInfo const&)>::_M_invoke(std::_Any_data const&, node::StartExecutionCallbackInfo const&) [adc]
 5: 0xf17d62 node::StartExecution(node::Environment*, std::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [adc]
 6: 0xe65bb6 node::LoadEnvironment(node::Environment*, std::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>, std::function<void (node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Value>)>) [adc]
 7: 0x103089d node::sea::MaybeLoadSingleExecutableApplication(node::Environment*) [adc]
 8: 0xfc42df node::NodeMainInstance::Run() [adc]
 9: 0xf1e9ab node::Start(int, char**) [adc]
10: 0x7e2835a2a1ca  [/lib/x86_64-linux-gnu/libc.so.6]
11: 0x7e2835a2a28b __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
12: 0xe5dbae _start [adc]

Error logs on Windows amd64:

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal
----- Native stack trace -----

 1: 00007FF6E259542D node::SetCppgcReference+17693
 2: 00007FF6E24F8389 node::OnFatalError+265
 3: 00007FF6E307ECCB v8::FunctionTemplate::RemovePrototype+299
 4: 00007FF6E2446F7F node::GetAnonymousMainPath+80383
 5: 00007FF6E2448065 node::GetAnonymousMainPath+84709
 6: 00007FF6E2542551 node::Start+1041
 7: 00007FF6E25D4ABB node::LoadEnvironment+235
 8: 00007FF6E24470D0 node::GetAnonymousMainPath+80720
 9: 00007FF6E249A471 v8_inspector::protocol::Binary::operator=+129521
10: 00007FF6E254340C node::Start+4812
11: 00007FF6E2542167 node::Start+39
12: 00007FF6E22AEEAC AES_cbc_encrypt+156892
13: 00007FF6E3DD4A14 inflateValidate+37524
14: 00007FFD3CA0E8D7 BaseThreadInitThunk+23
15: 00007FFD3E8AC53C RtlUserThreadStart+44

Error logs on macOS arm64:

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal
----- Native stack trace -----

 1: 0x100378b34 node::OnFatalError(char const*, char const*) [/usr/local/bin/adc]
 2: 0x100502780 v8::api_internal::ToLocalEmpty() [/usr/local/bin/adc]
 3: 0x1002aae10 std::__1::__function::__func<node::LoadEnvironment(node::Environment*, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void (node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Value>)>)::$_0, std::__1::allocator<node::LoadEnvironment(node::Environment*, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void (node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Value>)>)::$_0>, v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>::operator()(node::StartExecutionCallbackInfo const&) [/usr/local/bin/adc]
 4: 0x10033d1c0 node::StartExecution(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [/usr/local/bin/adc]
 5: 0x1002a9504 node::LoadEnvironment(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>, std::__1::function<void (node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Value>)>) [/usr/local/bin/adc]
 6: 0x1002a9604 node::LoadEnvironment(node::Environment*, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void (node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Value>)>) [/usr/local/bin/adc]
 7: 0x1003b88f0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/usr/local/bin/adc]
 8: 0x1003b86d0 node::NodeMainInstance::Run() [/usr/local/bin/adc]
 9: 0x100340800 node::Start(int, char**) [/usr/local/bin/adc]
10: 0x190a75d54 start [/usr/lib/dyld]

How often does it reproduce? Is there a required condition?

If I generate a SEA blob file on Node.js 22.20.0, it causes crashes regardless of which recent version I inline it into.

I've tested 20.15.0, 22.17.0, 22.18.0, and 22.20.0.

What is the expected behavior? Why is that the expected behavior?

As with previous versions, it can generate normal SEA blob files for use in building the final binary.

Specifically, blobs generated by 22.20.0 should be usable at least in 22.20.0.
They should also be usable in slightly older versions, though this is not strictly required. If this is not a "supported" operation I can understand that.

If a corrupted blob file is generated, then the build process is clearly broken. This cannot be considered expected behavior.

What do you see instead?

Again, if I generate a SEA blob file on Node.js 22.20.0, it causes crashes regardless of which recent version I inline it into.

I've tested 20.15.0, 22.17.0, 22.18.0, and 22.20.0.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    single-executableIssues and PRs related to single-executable applications

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions