4

When attaching WinDbg to my ASP.NET MVC app and calling !ClrStack -a when an exception has occurred, I'm seeing no locals or params values. All I see is <NO DATA> appear.

Why is this happening? What settings in my project can I check?

I appreciate I can see the objects in quesiton via a !dso call and finding the objects I'm interesting in the output, but that's not a good solution for me, since I need to know exactly the objects being passed into a specific function - I don't want to spend ages picking eah object address and doing a !do on them.

The app is built in DEBUG mode. When viewing a stack, all the methods and types appear in the output, so I'm assuming there is no issue with symbols, though I'm willing to try any commands necessary to re-sync or update the symbols if required.

The CPU architecture is ANY CPU and we are running Windows Server 2008 R2 64-bit.

I tried using SOSEX's !mk !mframe and !mdv commands, to list param and locals, but they show <UNAVAILABLE>.

EDIT:

Here is an example of the type of output I'm seeing:

Sample clrstack output with no data appearing

Jason Evans
  • 28,906
  • 14
  • 90
  • 154
  • Related: [Locals and parameters show ](http://stackoverflow.com/questions/23543365/why-locals-and-parameters-show-no-data-on-the-stackframe-when-using-sos-dll-to-d) and [!clrstack -p not giving values](http://stackoverflow.com/questions/10518588/clrstack-p-not-giving-the-values-of-the-parameters-for-the-methods-in-the-call) – Thomas Weller Apr 20 '15 at 19:57

1 Answers1

1

Why does this happen?

This happens for code optimized by the JIT compiler (your case) or release builds (by the compiler).

What settings in my project can I check?

Always check the symbol path and add Microsoft symbols if not done yet.

.symfix c:\debug\symbols
.reload

Next, check if WinDbg can find the symbols of your application using lm. It should show "private pdb symbols". If not, run

.sympath+ <path to your PDBs>

Other than that, SOSEX makes your life easier. Try the following:

!mk; *** Managed stack
!mframe <frame>; *** Switch to frame
!mdv; *** Dump values - This will at least give you the type
!mdv <frame>; *** Same as before but include !mframe
!mdso; *** Similar to !dso
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • I updated my question to inform about my attempt at using SOSEX. I will try the `.symfix` command when I'm back in the office tomorrow. Cheers for that. – Jason Evans Apr 20 '15 at 19:42
  • @JasonEvans: also check the output of `lm`. Add a `.sympath+ ` if it says something else than "private PDB symbols". I also added this to my answer. – Thomas Weller Apr 20 '15 at 19:47
  • I tan `lm` and saw the symbols for my code were `(deferred)`. I read [this SO question](http://stackoverflow.com/questions/15069220/windbg-lm-what-does-deferred-mean) but I'm stuck. Can you force WinDbg to load the symbols, as in don't be lazy loading them? – Jason Evans Apr 21 '15 at 07:33
  • Ahh OK. I just ran `.reload /f` to force symbol loading. I'll see if that makes a difference when it's finished. – Jason Evans Apr 21 '15 at 07:38
  • @JasonEvans: I have better experiences with `ld *` to load symbols of all modules. IMHO, `.reload /f` still only reloads those which have already been loaded. – Thomas Weller Apr 21 '15 at 18:40
  • I will try `ld *` tomorrow. Cheers for that. Learning a lot through these comments/answers. Great stuff :) – Jason Evans Apr 21 '15 at 19:57
  • Sorry for delay. I tried `ld *` and then `!ClrStack -a`, still getting `` appearing in the output. This is odd. I must be missing something obvious here. – Jason Evans May 01 '15 at 14:56
  • @JasonEvans: maybe it's just the optimization and you can't do anything about it. Can you share the dump so that I could try it? If I can get the information, I'll send you a full log with all commands to reproduce. – Thomas Weller May 01 '15 at 18:12