6

I have a dump of a .NET Universal App running on Raspberry Pi 2, Windows 10 IoT:

0:000> vertarget
Windows 10 Version 10240 MP (4 procs) Free ARM (NT) Thumb-2
Product: WinNt, suite: SingleUserTS
Built by: 10.0.10240.16384 (th1.150709-1700)

I see it uses coreclr like Silverlight did before.

0:000> lm vm coreclr
start    end        module name
6e430000 6e7fd000   coreclr    (export symbols)       coreclr.dll
    Loaded symbol image file: coreclr.dll
    ...
    Timestamp:        Thu Jul 16 21:37:39 2015 (55A88693)
    ...
    File version:     4.6.23117.0
    Product version:  4.0.23117.0

Doing an !analyze -v does not download SOS automatically.

Loading the Silverlight version of SOS I found on my PC indicates the wrong version:

0:000> .load C:\Program Files\Microsoft Silverlight\5.1.20513.0\sos.dll

0:000> !threads
The version of SOS does not match the version of CLR you are debugging.  Please
load the matching version of SOS for the version of CLR you are debugging.
CLR Version: 4.6.23117.0
SOS Version: 5.1.20513.0
Failed to load data access DLL, 0x80004005
...

It seems that SOS was implemented on GitHub but I could not find a binary download.

On my PC with Visual Studio 2015 Community, I could find a file called mrt100sos.dll in the folder C:\Program Files\MSBuild\Microsoft\.NetNative\x86\ which turns out to be a debugging extension and says:

0:000> !help   
mrt100sos is a debugger extension DLL designed to aid in debugging .NET Native
programs.
...

which sounded great. But running any commands results in the following error message:

0:000> !threads
Failed to find runtime DLL (mrt100_app.dll), 0x80004005
Extension commands need mrt100_app.dll in order to have something to do.

I'm running out of ideas...

How do I debug a .NET universal app dump in a way that I can see the .NET callstack?, which IMHO results in the question Where can I get SOS for Windows 10 IoT?

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • 3
    This is a really good question. I'll ask around. – vcsjones Aug 29 '15 at 22:07
  • I also logged in on Raspberry via PowerShell, but a `dir -s *sos.dll` revealed nothing. – Thomas Weller Aug 29 '15 at 23:03
  • Are you able to even use the native debugging commands? I though WinDbg required you to use it on the same platform that the dump was created on - so you would need an ARM version of WinDbg. – vcsjones Aug 29 '15 at 23:23
  • mrt100_app.dll is a .NET Native runtime support dll. It gets added to the package by the Store server in Redmond. Hehe, what could possibly go wrong? Testing .NET Native apps before you deploy them to the Store is essential, that's why the project has the option. – Hans Passant Aug 29 '15 at 23:26
  • Unofficially I've been told managed debugging extensions for ARM and Win 10 IoT doesn't exist now and to open an issue on the github repo to make sure. – vcsjones Aug 30 '15 at 00:26
  • 1
    @vcsjones: A copy of this question was posted as [an issue on Github](https://github.com/dotnet/coreclr/issues/1478). Thanks for the suggestion. Hopefully I'm notified of changes there so that an answer can be provided here. – Thomas Weller Sep 02 '15 at 21:39
  • @magicandre1981: it seems they don't want to provide the debug version of SOS for IoT. There does not seem to be an option to vote. I'm not familiar with Git, but I'll see whether I can build versions. Perhaps I can provide them for download then. – Thomas Weller Jun 06 '16 at 21:42
  • @vcsjones: it seems like your statement is correct. They don't want to provide the debug version of SOS for IoT. There does not seem to be an option to vote. I'm not familiar with Git, but I'll see whether I can build versions. Perhaps I can provide them for download then. – Thomas Weller Jun 06 '16 at 21:46

1 Answers1

1

The CoreCLR can be hosted in the cross-platform .NET Execution Runtime (DNX).
Thus, if you install ASP.NET 5 or Visual Studio 2015, you should have DNX on this path:
%userprofile%\.dnx

Via DNVM install (included with DNX), you should be able to install the exact same version of CoreCLR, but currently this doesn't work for 1.0.23430.0 - what we have in UWP10.0.

Anyway, SOS at %userprofile%\.dnx\runtimes\dnx-coreclr-win-x86.1.0.0-rc1-update1\bin\sos.dll seems to work, even if there's a small version mismatch:

The version of SOS does not match the version of CLR you are debugging. Please load the matching version of SOS for the version of CLR you are debugging. CLR Version: 4.6.23430.0 SOS Version: 4.6.23516.1

White hawk
  • 1,468
  • 1
  • 15
  • 23
  • I have VS 2015 installed, but there's no `%userprofile%\.dnx`folder. The Setup does not provide an option to install DNX. There is a folder `C:\Program Files\Microsoft DNX\Dnvm` but `dnvm install 1.0.23430.0` returns HTTP 404 (which is maybe what you expressed by 'doesn't work') – Thomas Weller May 30 '16 at 20:43
  • `dnvm install 1.0.0-rc1-update1` downloaded something. There is a SOS.dll in `C:\Program Files (x86)\Microsoft Web Tools\DNX\dnx-coreclr-win-x86.1.0.0-beta8\bin\sos.dll` on my PC. I now have a mscordacwks kind of problem for `mscordaccore_x86_arm_4.6.23117.00.dll`. Not sure if such cross-platform DLLs exist - and I've not seen a ARM version of WinDbg yet. – Thomas Weller May 30 '16 at 21:06