Get-WmiObject : The type initializer for ‘System.Management.MTAHelper’ threw an exception

Hi all,   Sometime ago a customer of mine had some problems in his x64 machine when running WMI queries in Powershell. Take for instance the following query:  ” Get-WMIObject Win32_LogicalDisk ”   It failed with the following error: ” Get-WmiObject : The type initializer for ‘System.Management.MTAHelper’ threw an exception. At line:1 char:14 + Get-WMIObject…

4

MANAGED DEBUGGING with WINDBG. Locks

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Breaking on an Exception. Part 2.   LOCKS   ·         We can see threads waiting for managed locks: All managed objects have a syncblock (4 bytes) before their Method Table and properties. It can hold locking information for thread-safe operations. All syncblocks being…

0

MANAGED DEBUGGING with WINDBG. Breaking on an Exception. Part 2

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Breaking on an Exception. Part 1.   BREAKING ON AN EXCEPTION. Part 2   What happens if !PrintException doesn’t return anything, or when we break (i.e. with a breakpoint or manually – Ctrl+Break) we can’t see mscorwks!RaiseTheExceptionInternalOnly in the call stack? What if…

1

MANAGED DEBUGGING with WINDBG. Breaking on an Exception. Part 1

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Managed Heap. Part 5.   BREAKING ON AN EXCEPTION. Part 1   We can only break on exceptions when doing live debugging, but many of the commands explained here can be used when doing dump analysis, too. ·         Exceptions we may get in…

2

MANAGED DEBUGGING with WINDBG. Managed Heap. Part 5

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Managed Heap. Part 4.   MANAGED HEAP. Part 5   ·         We can troubleshoot Loader Heap issues: An assembly can’t be unloaded while the AppDomain where it was created is still alive. We will get a memory leak if we keep creating new…

0

MANAGED DEBUGGING with WINDBG. Managed Heap. Part 4

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Managed Heap. Part 3.   MANAGED HEAP. Part 4   ·         We can troubleshoot Heap issues: These are some of the important performance counters we can check with Performance Monitor when having memory issues with .NET applications: §  Process:Private Bytes: All the memory…

0

MANAGED DEBUGGING with WINDBG. Managed Heap. Part 3

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Managed Heap. Part 2.   MANAGED HEAP. Part 3   ·         We can take a look to which objects reference which objects in the heap: We may see many objects in the heap that we think should have been cleaned up already. If…

0

MANAGED DEBUGGING with WINDBG. Managed Heap. Part 2

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Managed Heap. Part 1.   MANAGED HEAP. Part 2   ·         We can take a look to the objects in the heap: We can see all objects in the heap: 0:004> !DumpHeap  Address       MT     Size 7b463c40 790fd0f0       12     7b463c4c 790fd8c4       36     7b463c70 790fd8c4      …

0

MANAGED DEBUGGING with WINDBG. Managed Heap. Part 1

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Thread Stacks. Part 2.   MANAGED HEAP. Part 1   .NET won’t use the NT Heap. It saves some virtual memory for its own managed heap instead. Objects in the managed heap are part of a Garbage Collector (GC) generation. We have Gen…

0

MANAGED DEBUGGING with WINDBG. Thread Stacks. Part 2

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Thread Stacks. Part 1.   THREAD STACKS. Part 2   ·         We can inspect the objects with unmanaged commands: The reference to an object points to the method table (which is a pointer to the table with the method descriptors) followed by the…

0