Skip to content

src: avoid print incorrect windows stack frame names - #67999

Open
legendecas wants to merge 2 commits into
nodejs:mainfrom
legendecas:win-stack-printer-pdb
Open

legendecas wants to merge 2 commits into
nodejs:mainfrom
legendecas:win-stack-printer-pdb

Conversation

@legendecas

@legendecas legendecas commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

When node.exe is downloaded from the official release, without downloading the companion ~800MB pdb file, the default native backtrace printer prints incorrect stack frame names.

This patch fixes that when the stack frame can be determined to be inaccurate, do not resolve the frame names, and print an offset only:

$ ./out/Release/node --max-heap-size=10 -e 'var idx = 0; while (true) {global[idx++] = new Array(10_000_000) }'

<--- Last few GCs --->

[28176:00000185CC704000]       39 ms: Mark-Compact (reduce) 2.9 (3.9) -> 2.9 (3.9) MB, pooled: 0.0 MB, 1.00 / 0.00 ms (average mu = 0.140, current mu = 0.087) last resort; GC in old space requested
[28176:00000185CC704000]       41 ms: Mark-Compact (reduce) 2.9 (3.9) -> 2.9 (3.9) MB, pooled: 0.0 MB, 1.39 / 0.00 ms (average mu = 0.071, current mu = 0.004) last resort; GC in old space requested

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 00007FF672D065F2 node+0x5765f2
 2: 00007FF672BACFA6 node+0x41cfa6
 3: 00007FF672BAD4D0 node+0x41d4d0
 4: 00007FF673EC860A node+0x173860a
 5: 00007FF673C5F1FB node+0x14cf1fb
 6: 00007FF673C72C0D node+0x14e2c0d
 7: 00007FF673C9CDFF node+0x150cdff
 8: 00007FF673C9CD95 node+0x150cd95
 9: 00007FF673833237 node+0x10a3237
10: 00007FF673831EF2 node+0x10a1ef2
11: 00007FF673831E7C node+0x10a1e7c
12: 00007FF67383CFD4 node+0x10acfd4
13: 00007FF673663412 node+0xed3412
14: 00007FF673677777 node+0xee7777
15: 00007FF673677464 node+0xee7464
16: 00007FF673642851 node+0xeb2851
17: 00007FF673B3B315 node+0x13ab315
18: 00007FF673B3B064 node+0x13ab064
19: 00007FF673EE7936 node+0x1757936
20: 00007FF673EE7D96 node+0x1757d96
21: 00007FF672D704F4 node+0x5e04f4
22: 00007FF672B25116 node+0x395116
23: 00007FF672B24E8B node+0x394e8b
24: 00007FF672C21C8E node+0x491c8e
25: 00007FF674380A62 node+0x1bf0a62
26: 00007FF6761F2F3F node+0x3a62f3f
27: 00007FFB296CDDA7 BaseThreadInitThunk+23
28: 00007FFB2B67EE4C RtlUserThreadStart+44

Symbols for node.exe were not found, so its frames are shown as offsets. Put the matching .pdb file next to it or on _NT_SYMBOL_PATH to get function names.

The behavior can be verified locally by moving the ./out/Release/node.pdb file away.

Fixes: #53361

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. debugger Issues and PRs related to the Node.js command-line debugger. needs-ci PRs that need a full CI run. labels Dec 3, 2026
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
@legendecas
legendecas force-pushed the win-stack-printer-pdb branch from f28f606 to 3055600 Compare December 3, 2026 19:28
@legendecas legendecas added the windows Issues and PRs related to the Windows platform. label Dec 3, 2026
@legendecas

Copy link
Copy Markdown
Member Author

/cc @nodejs/platform-windows

@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.57%. Comparing base (9cf1a9c) to head (9866feb).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/debug_utils.cc 25.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67999      +/-   ##
==========================================
- Coverage   90.58%   90.57%   -0.02%     
==========================================
  Files         802      802              
  Lines      286955   287032      +77     
  Branches    55417    55431      +14     
==========================================
+ Hits       259945   259983      +38     
- Misses      17107    17139      +32     
- Partials     9903     9910       +7     
Files with missing lines Coverage Δ
src/debug_utils.h 81.25% <100.00%> (+1.25%) ⬆️
src/debug_utils.cc 57.97% <25.00%> (-0.99%) ⬇️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@addaleax addaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this! Just one question

Comment thread src/debug_utils.cc Resolved
@addaleax addaleax added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 3, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 3, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@legendecas

legendecas commented Dec 3, 2026 •

Copy link
Copy Markdown
Member Author

Seems like CI also drops the pdb file between stages.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@legendecas legendecas added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. debugger Issues and PRs related to the Node.js command-line debugger. needs-ci PRs that need a full CI run. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inaccurate windows stacktrace printer

4 participants