Repository navigation
Entering async IIFE in REPL triggers DCHECK #38685
Copy link
Copy link
Closed
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Activity
targos commentedon Nov 20, 2021
Is this still a bug? Does it exist on all supported Node.js versions?
addaleax commentedon Nov 23, 2021
@targos It appears to be gone on
master, which is good enough for me. I think we’d want a regression test, though.binvb commentedon Dec 1, 2021
it's my first issue for node project, please check it , thank you
addaleax commentedon Dec 1, 2021
@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 setterminal: truein the REPL options in order to be able to reproduce the issue.rubiagatra commentedon May 29, 2022
@addaleax how can I replicate this? I am using latest LTS
dignat commentedon Sep 26, 2022
Hi, everyone. Is this still an issue? Can I pick it as a good first issue?
Pleuvens commentedon Nov 10, 2023
Hi, can I pick this issue ?
BharathPESU commentedon Nov 4, 2025
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?
1042422227 commentedon Nov 5, 2025
test: async iife in repl
test: async iife in repl
test: async iife in repl
test: async iife in repl
test: async iife in repl
test: async iife in repl
test: async iife in repl