Skip to content

Node.js V8 Crash in Debugging Mode When Using for...of Loops #58460

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

Open
DerErzengel opened this issue May 26, 2025 · 1 comment
Open

Node.js V8 Crash in Debugging Mode When Using for...of Loops #58460

DerErzengel opened this issue May 26, 2025 · 1 comment
Labels
needs more info Issues without a valid reproduction.

Comments

@DerErzengel
Copy link

DerErzengel commented May 26, 2025

Version

v23.7.0

Platform

Microsoft Windows NT 10.0.26100.0 x64

Subsystem

No response

What steps will reproduce the bug?

I've repeatedly encountered an issue where Node.js crashes completely in different scenarios when I'm debugging code that contains a for...of loop. The crash seems to occur specifically before the execution of the loop.

Here’s a minimal example of the problematic code:

for (const [i, assetId] of assetIds.entries()) {
  let [error] = await this.account.listing.create(assetId, price, marketName);

  if (error instanceof Errors.WalletError) {
    await acceptListingsHandler();
    break;
  }

  assetIds = assetIds.filter((item) => item !== assetId);
}

This is the StackTrace:

#
# Fatal error in , line 0
# Check failed: needs_context && current_scope_ == closure_scope_ && current_scope_->is_function_scope() && !function_.is_null() implies function_->context() != *context_.
#
#
#
#FailureMessage Object: 000000F55B9FDE00
----- Native stack trace -----

 1: 00007FF69E86780D node::SetCppgcReference+16573
 2: 00007FF69E74819F node::TriggerNodeReport+74511
 3: 00007FF69FA99AB1 V8_Fatal+225
 4: 00007FF69F3CD856 v8::Unwinder::TryUnwindV8Frames+313990
 5: 00007FF69F3CFBF5 v8::Unwinder::TryUnwindV8Frames+323109
 6: 00007FF69F3CE2BC v8::Unwinder::TryUnwindV8Frames+316652
 7: 00007FF69F3D0BCD v8::Unwinder::TryUnwindV8Frames+327165
 8: 00007FF69EF2EBA6 v8_inspector::V8DebuggerId::toString+17766
 9: 00007FF69EF2FBCD v8_inspector::V8DebuggerId::toString+21901
10: 00007FF69EF32286 v8_inspector::V8DebuggerId::toString+31814
11: 00007FF69EF237C1 v8_inspector::V8Inspector::create+37345
12: 00007FF69EF1B88D v8_inspector::V8Inspector::create+4781
13: 00007FF69EF26DB9 v8_inspector::V8Inspector::create+51161
14: 00007FF69EF22AC1 v8_inspector::V8Inspector::create+34017
15: 00007FF69F3C704B v8::Unwinder::TryUnwindV8Frames+287355
16: 00007FF69F3C168F v8::Unwinder::TryUnwindV8Frames+264383
17: 00007FF69EFCDDA0 v8::internal::Version::GetString+469712
18: 00007FF69F587773 v8::PropertyDescriptor::writable+738851
19: 00007FF69F66D332 v8::PropertyDescriptor::writable+1679842
20: 00007FF69F4E4A52 v8::PropertyDescriptor::writable+71938
21: 00007FF69F5291C1 v8::PropertyDescriptor::writable+352369
22: 00007FF69F4E4A52 v8::PropertyDescriptor::writable+71938
23: 00007FF69F607D69 v8::PropertyDescriptor::writable+1264665
24: 00007FF69F514923 v8::PropertyDescriptor::writable+268243
25: 00007FF69F4E24A3 v8::PropertyDescriptor::writable+62291
26: 00007FF69F37FDDA v8::Isolate::NumberOfHeapSpaces+2634
27: 00007FF69F37FECB v8::Isolate::NumberOfHeapSpaces+2875
28: 00007FF69F380C04 v8::Isolate::NumberOfHeapSpaces+6260
29: 00007FF69F354AD7 v8::base::CPU::has_sse41+1671
30: 00007FF69F354740 v8::base::CPU::has_sse41+752
31: 00007FF69E8ABA32 node::CallbackScope::~CallbackScope+530
32: 00007FF69E8AB8AE node::CallbackScope::~CallbackScope+142
33: 00007FF69E85D987 node_api_throw_syntax_error+188519
34: 00007FF69E8DEA7E uv_req_type_name+1182
35: 00007FF69E8DB18F uv_run+1375
36: 00007FF69E8AB025 node::SpinEventLoop+405
37: 00007FF69E77884A v8::CpuProfileNode::GetParent+188650
38: 00007FF69E817B3C node::Start+4796
39: 00007FF69E8168A7 node::Start+39
40: 00007FF69E53F6AD AES_cbc_encrypt+158941
41: 00007FF6A01B9C34 inflateValidate+29972
42: 00007FFD921FE8D7 BaseThreadInitThunk+23
43: 00007FFD93DF14FC RtlUserThreadStart+44

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

The crash is difficult to reproduce consistently. Sometimes it works after a while, or if I switch to a different type of loop (e.g., a for loop with an index), the issue disappears.

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

What do you see instead?

Additional information

No response

@juanarbol juanarbol added the needs more info Issues without a valid reproduction. label May 26, 2025
@juanarbol
Copy link
Member

Hey, thanks for the repport.

This is not not a very useful Minimal reproducible example We don't have enough information. I'll mark this as "needs more info". That snippet is not enough for reproducing the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Issues without a valid reproduction.
Projects
None yet
Development

No branches or pull requests

2 participants