18

Someone asked me to get a call stack or stack trace of a running process so that he could analyze it for me.

How can I get that information?

2 Answers 2

38
  1. Get Process Explorer.

  2. Enable Show Details for All Processes from the File menu:

    enter image description here

  3. In the main pane, select the process you're interested in:

    enter image description here

  4. Open the context menu (right-click) for the selected process and click Properties:

    enter image description here

  5. On the Threads tab, you'll be able to see a list of the running threads inside that process:

    enter image description here

  6. Select the thread you're interested in and click the Stack button:

    enter image description here

  7. Process Explorer will now display the current call stack for the selected thread:

    enter image description here

Symbols

If your troubleshooting requires you to get more detail, it is often very helpful to load debugging symbols into Process Explorer. This is how:

  1. If you don't already have a Windows debugger installed, you're going to have to install the Debugging Tools for Windows first.

  2. In Process Explorer, open Configure Symbols... from the Options menu:

    enter image description here

  3. If you have the Debugging Tools (or another Windows debugger) installed, Process Explorer will automatically find the dbghelp.dll file. Otherwise, set the correct path here.

    enter image description here

    The Symbols path should look something like:

    SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols
    

    The only part you'll want to adjust is C:\Symbols. That's the location where the debugging symbols will be cached.

1
  • is there a way to dump all threads call stacks to file?
    – bgura
    Jun 23, 2017 at 14:00
0

If you need a stack of clr process, you can use ProcInsp (I'm its developer, the tool is free for use).

  1. Install ProcInsp
  2. Find the process you are interested in and click on it List of processes
  3. Click on the thread (note, that ProcInsp shows app's entry point as the name of the thread - it skips all frames of .net infrastructure) List of threads
  4. The stack trace with entrypoint highlighted is shown Stacktrace

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .