Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entering async IIFE in REPL triggers DCHECK #38685

Open
addaleax opened this issue May 14, 2021 · 7 comments · May be fixed by #44878
Open

Entering async IIFE in REPL triggers DCHECK #38685

addaleax opened this issue May 14, 2021 · 7 comments · May be fixed by #44878
Labels
good first issue Issues that are suitable for first-time contributors. inspector Issues and PRs related to the V8 inspector protocol test Issues and PRs related to the tests. v8 engine Issues and PRs related to the V8 dependency.

Comments

@addaleax
Copy link
Member

addaleax commented May 14, 2021

  • 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

@addaleax addaleax added v8 engine Issues and PRs related to the V8 dependency. inspector Issues and PRs related to the V8 inspector protocol labels May 14, 2021
@targos
Copy link
Member

targos commented Nov 20, 2021

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

@addaleax
Copy link
Member Author

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

@addaleax addaleax added good first issue Issues that are suitable for first-time contributors. test Issues and PRs related to the tests. labels Nov 23, 2021
@binvb
Copy link

binvb commented Dec 1, 2021

@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

@addaleax
Copy link
Member Author

addaleax commented 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 set terminal: true in the REPL options in order to be able to reproduce the issue.

@rubiagatra
Copy link

@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 }
}

@dignat
Copy link

dignat commented Sep 26, 2022

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

@tony-go tony-go linked a pull request Oct 3, 2022 that will close this issue
@Pleuvens
Copy link

Hi, can I pick this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are suitable for first-time contributors. inspector Issues and PRs related to the V8 inspector protocol test Issues and PRs related to the tests. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@addaleax @dignat @targos @rubiagatra @Pleuvens @binvb and others