Inaccurate windows stacktrace printer
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.3k
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 283
描述
Version
v20.11.1
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
debug util
What steps will reproduce the bug?
One line quick reproduction:
$ node --max-heap-size=10 -e 'var idx = 0; while (true) {global[idx++] = new Array(10_000_000) }'
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Expected stack trace:
1: 00007FF73361E1CB node::DumpNativeBacktrace+155 [D:\dev\nodejs\node\src\debug_utils.cc]:L322
2: 00007FF733554C24 node::OOMErrorHandler+324 [D:\dev\nodejs\node\src\node_errors.cc]:L621
3: 00007FF73483A5D1 v8::Utils::ReportOOMFailure+33 [D:\dev\nodejs\node\deps\v8\src\api\api.cc]:L350
4: 00007FF734821E96 v8::internal::V8::FatalProcessOutOfMemory+694 [D:\dev\nodejs\node\deps\v8\src\api\api.cc]:L302
5: 00007FF7345952B0 v8::internal::Heap::FatalProcessOutOfMemory+32 [D:\dev\nodejs\node\deps\v8\src\heap\heap.cc]:L6314
6: 00007FF734590CFD v8::internal::Heap::CollectGarbage+1229 [D:\dev\nodejs\node\deps\v8\src\heap\heap.cc]:L1967
7: 00007FF7345AFEC4 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath+2084 [D:\dev\nodejs\node\deps\v8\src\heap\heap-allocator.cc]:L108
8: 00007FF7345B0B5A v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath+90 [D:\dev\nodejs\node\deps\v8\src\heap\heap-allocator.cc]:L124
9: 00007FF7345C092D v8::internal::Factory::AllocateRaw+541 [D:\dev\nodejs\node\deps\v8\src\heap\factory.cc]:L284
10: 00007FF7345DDA1C v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArray+108 [D:\dev\nodejs\node\deps\v8\src\heap\factory-base.cc]:L172
What do you see instead?
Actual stack trace:
1: 00007FF73D0971AB node::SetCppgcReference+16075
2: 00007FF73D00DCC6 v8::base::CPU::num_virtual_address_bits+79190
3: 00007FF73D00FED5 v8::base::CPU::num_virtual_address_bits+87909
4: 00007FF73DA7F061 v8::Isolate::ReportExternalAllocationLimitReached+65
5: 00007FF73DA687F8 v8::Function::Experimental_IsNopFunction+1336
6: 00007FF73D8CA120 v8::Platform::SystemClockTimeMillis+659328
7: 00007FF73D8C71A8 v8::Platform::SystemClockTimeMillis+647176
8: 00007FF73D8DC4BA v8::Platform::SystemClockTimeMillis+733978
9: 00007FF73D8DCD37 v8::Platform::SystemClockTimeMillis+736151
10: 00007FF73D8E596E v8::Platform::SystemClockTimeMillis+772046
Additional information
Only reproducible on Windows release build downloaded from https://nodejs.org/download/ and https://nodejs.org/dist/. Local .\vcbuild.bat build can output correct stacktrace.
This is not related to https://github.com/nodejs/node/pull/50849 since that only released in v20.12.0. This problem can reproduce on v20.11.1 and previous versions.
/cc @joyeecheung
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用下载的 Windows release build 运行提供的内存不足命令,然后将其输出与本地 .\vcbuild.bat build 进行比较。检查 src/debug_utils.cc,以及报告的 node::DumpNativeBacktrace 位置附近的堆栈跟踪行为。当 Windows release build 打印出预期的符号、函数名、源代码路径和行号时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp, javascript, nodejs
- 领域
- devtools, operating-systems
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100