Skip to content

Node 22.5.0 started to crash and hangs on different cases #53902

Description

@zloirock

Version

22.5.0

Platform

macOS 15.0, M1

What steps will reproduce the bug?

Now I haven't much time to properly debug it, so a couple of cases:

Clone core-js repo.

npm i just hangs on.

Ok, if we somehow install dependencies and run npm test, Node crashes with:

FATAL ERROR: v8::Object::GetCreationContextChecked No creation context available
----- Native stack trace -----

 1: 0x104a4e230 node::OnFatalError(char const*, char const*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 2: 0x104c20898 v8::Utils::ReportApiFailure(char const*, char const*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 3: 0x104c358fc v8::Object::GetCreationContextChecked() [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 4: 0x104a55f88 node::fs::FastClose(v8::Local<v8::Object>, int, v8::FastApiCallbackOptions&) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 5: 0x10b9accc4 
 6: 0x1056a6c0c Builtins_JSEntryTrampoline [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 7: 0x1056a68f4 Builtins_JSEntry [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 8: 0x104d50564 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 9: 0x104d4fadc v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
10: 0x104c369cc v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
11: 0x104970fa0 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
12: 0x104987d8c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
13: 0x104a53ca4 node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
14: 0x104a549a8 node::fs::AfterInteger(uv_fs_s*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
15: 0x104a482fc node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
16: 0x105684a70 uv__work_done [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
17: 0x105688544 uv__async_io [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
18: 0x10569ab08 uv__io_poll [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
19: 0x105688b08 uv_run [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
20: 0x104971714 node::SpinEventLoopInternal(node::Environment*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
21: 0x104a8f8f0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
22: 0x104a8f688 node::NodeMainInstance::Run() [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
23: 0x104a15928 node::Start(int, char**) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
24: 0x18b2cf274 start [/usr/lib/dyld]


#
# Fatal error in , line 0
# Missing deoptimization information for OptimizedFrame::Summarize.
#
#
#
#FailureMessage Object: 0x16b488648
----- Native stack trace -----

 1: 0x104ab7a4c node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 2: 0x105f3e5d4 V8_Fatal(char const*, ...) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 3: 0x104d5993c v8::internal::OptimizedFrame::Summarize(std::__1::vector<v8::internal::FrameSummary, std::__1::allocator<v8::internal::FrameSummary>>*) const [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 4: 0x104d62c60 v8::internal::Isolate::CaptureDetailedStackTrace(int, v8::StackTrace::StackTraceOptions) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 5: 0x104c2ace0 v8::StackTrace::CurrentStackTrace(v8::Isolate*, int, v8::StackTrace::StackTraceOptions) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 6: 0x104a4cc0c node::GetCurrentStackTrace(v8::Isolate*, int) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 7: 0x1049b869c node::DumpJavaScriptBacktrace(__sFILE*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 8: 0x104a4e238 node::OnFatalError(char const*, char const*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
 9: 0x104c20898 v8::Utils::ReportApiFailure(char const*, char const*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
10: 0x104c358fc v8::Object::GetCreationContextChecked() [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
11: 0x104a55f88 node::fs::FastClose(v8::Local<v8::Object>, int, v8::FastApiCallbackOptions&) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
12: 0x10b9accc4 
13: 0x1056a6c0c Builtins_JSEntryTrampoline [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
14: 0x1056a68f4 Builtins_JSEntry [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
15: 0x104d50564 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
16: 0x104d4fadc v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
17: 0x104c369cc v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
18: 0x104970fa0 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
19: 0x104987d8c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
20: 0x104a53ca4 node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
21: 0x104a549a8 node::fs::AfterInteger(uv_fs_s*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
22: 0x104a482fc node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
23: 0x105684a70 uv__work_done [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
24: 0x105688544 uv__async_io [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
25: 0x10569ab08 uv__io_poll [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
26: 0x105688b08 uv_run [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
27: 0x104971714 node::SpinEventLoopInternal(node::Environment*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
28: 0x104a8f8f0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
29: 0x104a8f688 node::NodeMainInstance::Run() [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
30: 0x104a15928 node::Start(int, char**) [/Users/denispuskarev/.nvm/versions/node/v22.5.0/bin/node]
31: 0x18b2cf274 start [/usr/lib/dyld]
/bin/bash: line 1: 92352 Trace/BPT trap: 5       npm run build-compat

on this script.

The same error happens, for example, if we somehow built it (for example, with the previous Node version) and run other scripts like this.

In most of those cases used zx and / or konan.

Sure, before Node 22.5.0, everything worked fine.

Activity

  1. added
    fsIssues and PRs related to file-system APIs and the fs module.
    v8 engineIssues and PRs related to the V8 dependency.
    on Jul 17, 2024
  2. avivkeller commented on Jul 17, 2024

    @avivkeller
    Member

    Given the stack trace you've produced, I've optimistically applied the fs and v8 engine labels, but those can always be changed.

  3. cjihrig commented on Jul 17, 2024

    @cjihrig
    Contributor

    #53627 seems like the likely culprit.

  4. avivkeller commented on Jul 17, 2024

    @avivkeller
    Member

    Also, for reference, the erroring line is

    Environment* env = Environment::GetCurrent(recv->GetCreationContextChecked());

  5. merceyz commented on Jul 17, 2024

    @merceyz
    Member

    Similar issue showing up in Yarn (yarnpkg/berry#6398), it either hangs or if run with CI=true then node stops mid execution without an error code.
    Bisects to #53627.

  6. added
    confirmed-bugIssues and PRs for confirmed bugs.
    regressionIssues related to regressions.
    v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.
    on Jul 17, 2024
  7. avivkeller commented on Jul 17, 2024

    @avivkeller
    Member

    I've opened a revert PR #53904 if this needs to be reverted.

  8. anonrig commented on Jul 17, 2024

    @anonrig
    Member

    @joyeecheung Any idea how is this possible?

    v8::Object::GetCreationContextChecked No creation context available

  9. anonrig commented on Jul 17, 2024

    @anonrig
    Member

    This needs a better repro than the following command which runs 10+ subprocesses.

    npm run r (that's cleaning + installing dependencies + npm test) just hangs on.

  10. avivkeller commented on Jul 17, 2024

    @avivkeller
    Member

    https://github.com/latin-1/berry-node-22.5.0-broken/ is slightly better, but not perfect.

    STREAM 55954: do read
    STREAM 55954: push null
    STREAM 55954: onEofChunk
    STREAM 55954: emitReadable_
    STREAM 55954: flow
    STREAM 55954: read undefined
    STREAM 55954: endReadable
    STREAM 55954: endReadableNT
    Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
    
  11. anonrig commented on Jul 17, 2024

    @anonrig
    Member

    I can not test it locally, but technically this should fix the bug: #53910

  12. targos commented on Jul 17, 2024

    @targos
    Member

    I think we should hold on landing future fast API pull requests until we have a way to guarantee that the added code paths are tested.

  13. 72 remaining items

  14. added a commit that references this issue on Jul 22, 2024
  15. danishasifdev commented on Mar 28, 2025

    @danishasifdev

    yes, the new version 22.5 was taking so much memory and eventually slowing down everything. I had to downgrade to version 20.19 which works best for me.

  16. added a commit that references this issue on Mar 27, 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

    confirmed-bugIssues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.regressionIssues related to regressions.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions