Issue
I used the StackWalker library (https://github.com/JochenKalmbach/StackWalker) as suggested by many people online for my C++ application. We deployed an executable without PDBs for security purposes. The executable crashed and now we have a stacktrace that I need to decode with the PDB. Does anyone know how to go about doing this? I can't imagine everyone promoted a library that is unable to decode the symbols in a stacktrace with a provided PDB. But if that's the case... shame on me :(. It's certainly been helpful in a debug setting at least.
Is there a better alternative to capturing a crash stack trace that can be decoded by PDBs later in time?
Snipper from the stack:
C:\IceNeurosystems\bin\ice-engine\mkl_core.dll:mkl_core.dll (00007FFA42130000), size: 69988352 (result: 0), SymType: '-exported-', PDB: 'C:\IceNeurosystems\bin\ice-engine\mkl_core.dll', fileVersion: 2019.0.1.1
C:\IceNeurosystems\bin\ice-engine\mkl_avx2.dll:mkl_avx2.dll (00007FFA3EE90000), size: 53043200 (result: 0), SymType: '-exported-', PDB: 'C:\IceNeurosystems\bin\ice-engine\mkl_avx2.dll', fileVersion: 2019.0.1.1
C:\IceNeurosystems\bin\ice-engine\mkl_vml_avx2.dll:mkl_vml_avx2.dll (00007FFA3E220000), size: 12984320 (result: 0), SymType: '-exported-', PDB: 'C:\IceNeurosystems\bin\ice-engine\mkl_vml_avx2.dll', fileVersion: 2019.0.1.1
C:\Windows\system32\napinsp.dll:napinsp.dll (00007FFA604A0000), size: 90112 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\napinsp.dll', fileVersion: 6.2.17763.1
C:\Windows\system32\pnrpnsp.dll:pnrpnsp.dll (00007FFA60480000), size: 106496 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\pnrpnsp.dll', fileVersion: 6.2.17763.1
C:\Windows\System32\winrnr.dll:winrnr.dll (00007FFA60470000), size: 57344 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\winrnr.dll', fileVersion: 6.2.17763.1
C:\Windows\system32\NLAapi.dll:NLAapi.dll (00007FFA602A0000), size: 110592 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\NLAapi.dll', fileVersion: 6.2.17763.134
C:\Windows\system32\wshbth.dll:wshbth.dll (00007FFA52100000), size: 86016 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\wshbth.dll', fileVersion: 6.2.17763.1
C:\Windows\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FFA52960000), size: 2019328 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\dbghelp.dll', fileVersion: 6.2.17763.1432
C:\Windows\SYSTEM32\SspiCli.dll:SspiCli.dll (00007FFA63B20000), size: 192512 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\SspiCli.dll', fileVersion: 6.2.17763.1490
ERROR: SymGetSymFromAddr64, GetLastError: 487 (Address: 00007FF670BA4305)
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF670BA4305)
00007FF670BA4305 (MyProgram): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 487 (Address: 00007FF670B99865)
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF670B99865)
00007FF670B99865 (MyProgram): (filename not available): (function-name not available)
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA64D2CE03)
00007FFA64D2CE03 (ucrtbase): (filename not available): seh_filter_exe
ERROR: SymGetSymFromAddr64, GetLastError: 487 (Address: 00007FF670F2E6F5)
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF670F2E6F5)
00007FF670F2E6F5 (MyProgram): (filename not available): (function-name not available)
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA48C6E3E0)
00007FFA48C6E3E0 (VCRUNTIME140): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA67CD4A2F)
00007FFA67CD4A2F (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA67C34CEF)
00007FFA67C34CEF (ntdll): (filename not available): RtlWalkFrameChain
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA67CD379E)
00007FFA67CD379E (ntdll): (filename not available): KiUserExceptionDispatcher
ERROR: SymGetSymFromAddr64, GetLastError: 487 (Address: 00007FF670BB3D33)
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF670BB3D33)
00007FF670BB3D33 (MyProgram): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 487 (Address: 00007FF670BB3A67)
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF670BB3A67)
Thanks!
Solution
I'd be surprised if StackWalker can symbolicate a stack trace after the fact. Looking at the API, it only reads the PDB when creating the stack trace in the first place.
I adopt a different approach when my software crashes. I use MiniDumpWriteDump to create a 'minidump' file which can then be read by Visual Studio or WinDbg. Visual Studio (and probably WinDbg) can then apply a PDB stored locally to provide a fully annotated stack trace (and more).
You should also be aware of Windows Error Reporting (WER). I don't use it myself but I hear good things about it.
Answered By - Paul Sanders Answer Checked By - Mary Flores (Python.Easybugfix Volunteer)
Post a Comment
Post a Comment