Skip to content

Entering async IIFE in REPL triggers DCHECK #38685

Description

@addaleax
  • Version: master
  • Platform: Linux
  • Subsystem: V8

What steps will reproduce the bug?

Enter (async() => { })() into a Node.js REPL, compiled with V8 debug checks enabled.

$ node
Welcome to Node.js v17.0.0-pre.
Type ".help" for more information.
> (async() => { })()

#
# Fatal error in ../deps/v8/src/debug/debug.cc, line 2379
# Debug check failed: isolate_->has_pending_exception().
#
#
#
#FailureMessage Object: 0x7ffcd43aad30
 1: 0x564eda0078a9  [node]
 2: 0x564edbc21f97 V8_Fatal(char const*, int, char const*, ...) [node]
 3: 0x564edbc21fc9  [node]
 4: 0x564eda3d96f8 v8::internal::Debug::StopSideEffectCheckMode() [node]
 5: 0x564eda399fb0 v8::internal::DebugEvaluate::Global(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::debug::EvaluateGlobalMode, v8::internal::REPLMode) [node]
 6: 0x564eda3a7675 v8::debug::EvaluateGlobal(v8::Isolate*, v8::Local<v8::String>, v8::debug::EvaluateGlobalMode, bool) [node]
 7: 0x564edae53caa v8_inspector::V8RuntimeAgentImpl::evaluate(v8_inspector::String16 const&, v8_crdtp::detail::ValueMaybe<v8_inspector::String16>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<int>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<double>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<bool>, v8_crdtp::detail::ValueMaybe<v8_inspector::String16>, std::unique_ptr<v8_inspector::protocol::Runtime::Backend::EvaluateCallback, std::default_delete<v8_inspector::protocol::Runtime::Backend::EvaluateCallback> >) [node]
 8: 0x564edafcc83e v8_inspector::protocol::Runtime::DomainDispatcherImpl::evaluate(v8_crdtp::Dispatchable const&) [node]
 9: 0x564edae7471f v8_crdtp::UberDispatcher::DispatchResult::Run() [node]
10: 0x564edae40677 v8_inspector::V8InspectorSessionImpl::dispatchProtocolMessage(v8_inspector::StringView) [node]
11: 0x564eda09e30b  [node]
12: 0x564eda0af395  [node]
13: 0x564eda261676 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [node]
14: 0x564eda26266d  [node]
15: 0x564eda267430  [node]
16: 0x564eda26814a v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
17: 0x564edb2b2140  [node]

/cc @nodejs/v8

Activity

  1. added
    v8 engineIssues and PRs related to the V8 dependency.
    inspectorIssues and PRs related to the V8 inspector protocol.
    on May 14, 2021
  2. targos commented on Nov 20, 2021

    @targos
    Member

    Is this still a bug? Does it exist on all supported Node.js versions?

  3. addaleax commented on Nov 23, 2021

    @addaleax
    MemberAuthor

    @targos It appears to be gone on master, which is good enough for me. I think we’d want a regression test, though.

  4. added
    good first issueIssues that are suitable for first-time contributors.
    testIssues and PRs related to Node.js core tests and test infrastructure.
    on Nov 23, 2021
  5. binvb commented on Dec 1, 2021

    @binvb

    @targos It appears to be gone on master, which is good enough for me. I think we’d want a regression test, though.

    it's my first issue for node project, please check it , thank you

  6. addaleax commented on Dec 1, 2021

    @addaleax
    MemberAuthor

    @binvb The PR seems okay, but it’s not a regression test because it doesn’t actually break for versions of Node.js in which this bug existed. You need to test the actual, literal string (async() => { })(), not some arbitrary async IIFE, and you need to set terminal: true in the REPL options in order to be able to reproduce the issue.

  7. rubiagatra commented on May 29, 2022

    @rubiagatra

    @addaleax how can I replicate this? I am using latest LTS

    ➜ ~ node
    Welcome to Node.js v16.15.0.
    Type ".help" for more information.
    > (async() => { })()
    Promise {
      undefined,
      [Symbol(async_id_symbol)]: 26,
      [Symbol(trigger_async_id_symbol)]: 5,
      [Symbol(destroyed)]: { destroyed: false }
    }
    
  8. dignat commented on Sep 26, 2022

    @dignat

    Hi, everyone. Is this still an issue? Can I pick it as a good first issue?

  9. Pleuvens commented on Nov 10, 2023

    @Pleuvens

    Hi, can I pick this issue ?

  10. BharathPESU commented on Nov 4, 2025

    @BharathPESU

    Hi — I’d like to take this one.

    Summary / reproduction

    REPL crash when evaluating an async IIFE:

    (async () => { })()

    on a Node build with V8 debug checks enabled (reported on master).

    Produces a fatal debug check in V8:

    Fatal error in ../deps/v8/src/debug/debug.cc, line 2379
    Debug check failed: isolate_->has_pending_exception().

    Stack shows the failure happening during V8 debug/evaluate paths (DebugEvaluate::Global, v8::debug::EvaluateGlobal, v8_inspector::V8RuntimeAgentImpl::evaluate, …), which suggests the REPL/evaluate path is leaving an unexpected pending exception flag when entering the debug/evaluate side-effect-check flow.

    Plan / next steps I will take

    Reproduce locally on master with a V8 build that has debug checks enabled to confirm the failure and gather full debug logs.

    Add minimal instrumentation around the V8 debug evaluate entry points to identify which code path leaves isolate_->has_pending_exception() in an unexpected state.

    Attempt a focused bisect in V8 (and Node’s V8 embed layer) to find the change that introduced the assertion, narrowing to either a V8 regression or an embedding mismatch in Node’s inspector/debug integration.

    Prepare a small V8 test case (or a Node-level test) that reproduces the assertion so it can be run in V8 CI.

    Propose and submit a fix upstream (either in Node's embed code around the debug evaluate entry/exit, or in V8 itself), plus a regression test.

    I’ll post repro build logs and the minimal test case in the issue shortly. Could you please assign this to me?

  11. 1042422227 commented on Nov 5, 2025

    @1042422227
  12. added a commit that references this issue on Nov 8, 2025
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

    good first issueIssues that are suitable for first-time contributors.inspectorIssues and PRs related to the V8 inspector protocol.testIssues and PRs related to Node.js core tests and test infrastructure.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