nodejs / nodejs/node

Fatal Error in V8 Debugging Context on Node.js v23.7.0

Abierto
#57,606 15 comentarios 5 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

inspector v8 engine
Lenguaje dominante
JavaScript
Estrellas
122k
Forks
37.3k
Merge medio
4 d 2 h
PR fusionados (30 d)
283

Descripción

Version

23.7.0

Platform
Darwin Apples-MacBook-Pro.local 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64
Subsystem

No response

What steps will reproduce the bug?
  • Run a script that involves debugging, breakpoints, or function scope evaluation
  • Observe the crash with the fatal error
How often does it reproduce? Is there a required condition?

The issue reproduces consistently when running a script that involves debugging, particularly with breakpoints, function scope evaluation, or closures.

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

The debugger should pause execution at the debugger; statement and allow the user to inspect variables within the function's scope without causing a crash or becoming unresponsive.

What do you see instead?

I encountered a fatal error while running Node.js v23.7.0, leading to a crash with the following message:

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_.

Additional information

Complete Error log trace if required

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: 0x16bc90698
----- Native stack trace -----

1: 0x1044899ac node::NodePlatform::GetStackTracePrinter()::$_0::__invoke() [/opt/homebrew/Cellar/node/23.6.1/bin/node]
2: 0x104f00f88 V8_Fatal(char const*, ...) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
3: 0x1046b264c v8::internal::ScopeIterator::start_position() [/opt/homebrew/Cellar/node/23.6.1/bin/node]
4: 0x1046b2fec v8::internal::ScopeIterator::VisitLocalScope(std::__1::function<bool (v8::internal::Handlev8::internal::String, v8::internal::Handlev8::internal::Object, v8::internal::ScopeIterator::ScopeType)> const&, v8::internal::ScopeIterator::Mode, v8::internal::ScopeIterator::ScopeType) const [/opt/homebrew/Cellar/node/23.6.1/bin/node]
5: 0x1046b254c v8::internal::ScopeIterator::ScopeObject(v8::internal::ScopeIterator::Mode) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
6: 0x104aa2fb0 v8_inspector::V8DebuggerAgentImpl::currentCallFrames(std::__1::unique_ptr<std::__1::vector<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>, std::__1::allocator<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>>>, std::__1::default_delete<std::__1::vector<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>, std::__1::allocator<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>>>>>) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
7: 0x104aa280c v8_inspector::V8DebuggerAgentImpl::didPause(int, v8::Localv8::Value, std::__1::vector<int, std::__1::allocator> const&, v8::debug::ExceptionType, bool, v8::base::EnumSet<v8::debug::BreakReason, int>) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
8: 0x104ab56b4 v8_inspector::V8InspectorImpl::forEachSession(int, std::__1::function<void (v8_inspector::V8InspectorSessionImpl
)> const&) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
9: 0x104aaaa40 v8_inspector::V8Debugger::handleProgramBreak(v8::Localv8::Context, v8::Localv8::Value, std::__1::vector<int, std::__1::allocator> const&, v8::base::EnumSet<v8::debug::BreakReason, int>, v8::debug::ExceptionType, bool) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
10: 0x1046ba754 v8::internal::Debug::OnDebugBreak(v8::internal::Handlev8::internal::FixedArray, v8::internal::StepAction, v8::base::EnumSet<v8::debug::BreakReason, int>) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
11: 0x1046ba074 v8::internal::Debug::Break(v8::internal::JavaScriptFrame*, v8::internal::Handlev8::internal::JSFunction) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
12: 0x104a214c4 v8::internal::Runtime_DebugBreakOnBytecode(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
13: 0x10420fc74 Builtins_CEntry_Return2_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/23.6.1/bin/node]
14: 0x1042e0368 Builtins_DebugBreak3Handler [/opt/homebrew/Cellar/node/23.6.1/bin/node]
15: 0x104178838 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/23.6.1/bin/node]
16: 0x1041b5e20 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/23.6.1/bin/node]
17: 0x104283298 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/23.6.1/bin/node]
18: 0x1041a5214 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/23.6.1/bin/node]
19: 0x1041763f0 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/23.6.1/bin/node]
20: 0x1046f2718 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
21: 0x1046f2e84 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
22: 0x10471d438 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
23: 0x10417a978 Builtins_CallApiCallbackGeneric [/opt/homebrew/Cellar/node/23.6.1/bin/node]
24: 0x12818bbdc
25: 0x10417650c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/23.6.1/bin/node]
26: 0x1041761b0 Builtins_JSEntry [/opt/homebrew/Cellar/node/23.6.1/bin/node]
27: 0x1046f2740 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
28: 0x1046f20a8 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
29: 0x1045d73bc v8::Function::Call(v8::Isolate
, v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
30: 0x1043316d4 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/23.6.1/bin/node]
31: 0x104331b94 node::InternalMakeCallback(node::Environment
, v8::Localv8::Object, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value, node::async_context, v8::Localv8::Value) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
32: 0x104349c9c node::AsyncWrap::MakeCallback(v8::Localv8::Function, int, v8::Localv8::Value
) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
33: 0x10451c37c node::StreamBase::CallJSOnreadMethod(long, v8::Localv8::ArrayBuffer, unsigned long, node::StreamBase::StreamBaseJSChecks) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
34: 0x10451c600 node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
35: 0x104522b40 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
36: 0x104522848 node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s*, long, uv_buf_t const*) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
37: 0x107a9ae6c uv__stream_io [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
38: 0x107aa20e0 uv__io_poll [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
39: 0x107a91f08 uv_run [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
40: 0x104332488 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
41: 0x10445fef0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
42: 0x10445fc44 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/23.6.1/bin/node]
43: 0x1043d889c node::Start(int, char**) [/opt/homebrew/Cellar/node/23.6.1/bin/node]
44: 0x183ba0274 start [/usr/lib/dyld]

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza reduciendo el escenario de debugger, breakpoint o closure informado a un script mínimo en Node.js v23.7.0; después, sigue el stack a través de v8::internal::ScopeIterator::start_position y v8_inspector::V8DebuggerAgentImpl::currentCallFrames. Se considera terminado cuando el script se pausa en debugger; y permite inspeccionar el ámbito de la función sin producir el error fatal ni dejar de responder; en el informe no se identifica ningún archivo de prueba.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, node.js
Área
backend, devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.