Debugging crashes - nvaccess/nvda GitHub Wiki
Debugging Crashes
To debug a crash in NVDA, or another application while NVDA was running, you will require a crash dump from the application that crashed.
For information on how to produce and find crash dumps, please look at the Log Files and Crash dumps article.
Debugging with WinDBG
GetWinDBG
You will need to download the Debugging Tools for Windows. Please see instructions at: https://developer.microsoft.com/en-us/windows/hardware/windows-driver-kit
Configure WinDBG UI
By default, WinDBG handles its windows such that you can't easily get to the menu bar with the keyboard while in one of the debugger windows. To fix:
- Open Windbg from the start menu
- Choose Window -> MDI Emulation
- Say Yes.
- Choose File -> Save Workspace.
- Close windbg
WinDBG Symbol Paths
To successfully debug an application, WinDBG requires symbol files for the application. WinDBG needs to know where these can be fetched. This usually only needs to be done once, though it depends on the project:
- Open Windbg
- Choose File -> Symbol file Paths...
- Type in a symbol path which includes the addresses for both the Microsoft Symbol server and NV Access symbol server. It is recommended that you also instruct WinDBG to cache symbols locally. For example:
cache*;srv*http://msdl.microsoft.com/download/symbols;srv*http://www.nvaccess.org/files/nvda/symbols
- Press Okay.
- Choose File -> Save Workspace.
- Close Windbg
Viewing the crash dump
Open the crash dump in windbg, either from Open With in File Explorer, or File -> Open Crash dump from within Windbg. Then, you can analyze the crash, using commands such as:
- Analyze (useful general info about the crash): !analyze -v,
- Show a clean call stack where the crash occured: .ecxr; kc
- Show a call stack with source path and line numbers where possible: .ecxr; kp
Extra notes:
- Some Windows insider builds do not have their symbols uploaded to the Microsoft symbol server. You may need to download a specific symbols archive from Microsoft if available.
- Symbols for NVDA snapshots and releases are available on the NV Access symbol server. However, if running from source, or a custom build, then you will need to point Windbg to the PDB files produced by that build.