Case of the Hung WPF Applications

When I RDP’d into a Windows 7 x64 machine I noticed WPF applications were hanging.  With some more testing I found any .NET 3.5 WPF app would hang at Window creation. I event tested a blank WPF project with no code, and the Window hung.

.NET 4.0 WPF apps were not affected. Using Task Manager I took some dump files…

image

Because this is a .NET app I loaded sos.dll then !analyze –v –hang

0:003> !analyze -v -hang
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

FAULTING_IP:
+0
00000000`00000000 ??              ???

EXCEPTION_RECORD:  ffffffffffffffff — (.exr 0xffffffffffffffff)
ExceptionAddress: 0000000000000000
   ExceptionCode: 80000003 (Break instruction exception)
  ExceptionFlags: 00000000
NumberParameters: 0

CONTEXT:  0000000000000000 — (.cxr 0x0;r)
rax=00000000000000da rbx=0000000000000080 rcx=0000000000000067
rdx=0000000000000073 rsi=0000000000000000 rdi=0000000000000003
rip=0000000076dc180a rsp=000000001bdaf038 rbp=0000000080100080
r8=000000000000006d  r9=000007fefa365613 r10=000007fefa364000
r11=0000000000000059 r12=0000000000000001 r13=0000000000000000
r14=0000000000000000 r15=000000001b67b860
iopl=0         nv up ei pl nz na pe nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000202
ntdll!ZwCreateFile+0xa:
00000000`76dc180a c3              ret

FAULTING_THREAD:  0000000000000000

BUGCHECK_STR:  HANG

DEFAULT_BUCKET_ID:  APPLICATION_HANG

PROCESS_NAME:  FujitsuInfoPanel.exe

ERROR_CODE: (NTSTATUS) 0xcfffffff – <Unable to get error code text>

EXCEPTION_CODE: (NTSTATUS) 0xcfffffff – <Unable to get error code text>

NTGLOBALFLAG:  400

APPLICATION_VERIFIER_FLAGS:  0

APP:  fujitsuinfopanel.exe

ANALYSIS_VERSION: 6.3.9600.17029 (debuggers(dbg).140219-1702) amd64fre

MANAGED_STACK:
(TransitionMU)
000000000016E400 000007FED93917AB WindowsBase_ni!DomainBoundILStubClass.IL_STUB(System.Windows.Interop.MSG ByRef, System.Runtime.InteropServices.HandleRef, Int32, Int32)+0x13b
000000000016E590 000007FED939E527 WindowsBase_ni!MS.Win32.UnsafeNativeMethods.GetMessageW(System.Windows.Interop.MSG ByRef, System.Runtime.InteropServices.HandleRef, Int32, Int32)+0x27
000000000016E5D0 000007FED9397745 WindowsBase_ni!System.Windows.Threading.Dispatcher.GetMessage(System.Windows.Interop.MSG ByRef, IntPtr, Int32, Int32)+0x95
000000000016E680 000007FED93975FE WindowsBase_ni!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)+0xde
000000000016E750 000007FED6B3B507 PresentationFramework_ni!System.Windows.Application.RunInternal(System.Windows.Window)+0xb7
000000000016E7C0 000007FF001601B8 FujitsuInfoPanel!Fujitsu_Info_Panel_WPF.App.Main()+0x98
(TransitionUM)

MANAGED_STACK_COMMAND:  _EFN_StackTrace

DERIVED_WAIT_CHAIN: 

Dl Eid Cid     WaitType
— — ——- ————————–
   0   1444.f90 Unknown               

WAIT_CHAIN_COMMAND:  ~0s;k;;

BLOCKING_THREAD:  0000000000000f90

PRIMARY_PROBLEM_CLASS:  APPLICATION_HANG

LAST_CONTROL_TRANSFER:  from 0000000076c89e9e to 0000000076c89e6a

STACK_TEXT: 
00000000`0016e328 00000000`76c89e9e : 00000000`00000000 00000000`002fe1f0 00000000`0016e378 00000002`00000030 : user32!ZwUserGetMessage+0xa
00000000`0016e330 000007fe`f0bdcd37 : 00000000`002eb3b8 00000000`0016e3a8 00000000`0016e5c8 00000000`01466c00 : user32!GetMessageW+0x34
00000000`0016e360 000007fe`d93917ab : 00000000`00000000 000007fe`d92ae2d8 00000000`00000000 00000000`002fe1f0 : mscorwks!DoNDirectCall__PatchGetThreadCall+0x7b
00000000`0016e400 000007fe`d939e527 : 00000000`00000000 00000000`0016e5b0 000002f5`13d4066e 00000000`00000245 : WindowsBase_ni+0x1117ab
00000000`0016e590 000007fe`d9397745 : 00000000`0016ec00 00000000`0016e4d1 00000000`0016e5c8 00000000`0016e6d0 : WindowsBase_ni+0x11e527
00000000`0016e5d0 000007fe`d93975fe : 00000000`02e82660 00000000`0016e6d0 00000000`00000000 00000000`00000000 : WindowsBase_ni+0x117745
00000000`0016e680 000007fe`d6b3b507 : 00000000`02e4a6a8 00000000`00000001 00000000`00000000 000007fe`d68314b8 : WindowsBase_ni+0x1175fe
00000000`0016e750 000007ff`001601b8 : 00000000`02e84f70 00000000`02e85058 00000000`02e82734 00000000`000f011a : PresentationFramework_ni+0x30b507
00000000`0016e7c0 000007fe`f0bdd512 : 000007ff`00027778 000007fe`f0a82dd9 00000000`00000000 000007ff`000276f8 : 0x000007ff`001601b8
00000000`0016e800 000007fe`f0acb693 : 00000000`00000000 00000000`00000050 000007fe`f0997480 00000000`00000000 : mscorwks!CallDescrWorker+0x82
00000000`0016e840 000007fe`f0fbaac1 : 00000000`0016e978 00000000`00000000 00000000`00000001 00000000`00000000 : mscorwks!CallDescrWorkerWithHandler+0xd3
00000000`0016e8e0 000007fe`f0b2848b : 00000000`00000000 000007ff`000276f8 00000000`00000000 00000000`0016ede0 : mscorwks!MethodDesc::CallDescr+0x2b1
00000000`0016eb20 000007fe`f0b4bbb0 : 00000000`00000000 00000000`00000000 00000005`00ca000d 00000000`00000000 : mscorwks!ClassLoader::RunMain+0x22b
00000000`0016ed80 000007fe`f10a743d : 00000000`0016f3d0 00000000`00000000 00000000`0030d0f8 00000000`00000200 : mscorwks!Assembly::ExecuteMainMethod+0xbc
00000000`0016f070 000007fe`f0b590d7 : 00000000`00000000 00000000`00000000 00000000`00000000 000007fe`f0b743de : mscorwks!SystemDomain::ExecuteMainMethod+0x47d
00000000`0016f640 000007fe`f0b3bdf4 : ffffffff`fffffffe 00000000`00000000 0000ef9d`00000000 00000000`00000000 : mscorwks!ExecuteEXE+0x47
00000000`0016f690 000007fe`f81477ad : ffffffff`ffffffff 00000000`002fe1f0 00000000`00000000 00000000`0016f698 : mscorwks!CorExeMain+0xac
00000000`0016f6f0 000007fe`f81e5b21 : 00000000`00000000 000007fe`f0b3bd48 00000000`00000000 00000000`00000000 : mscoreei!CorExeMain+0xe0
00000000`0016f740 00000000`76b6652d : 000007fe`f8140000 00000000`00000000 00000000`00000000 00000000`00000000 : mscoree!CorExeMain_Exported+0x57
00000000`0016f770 00000000`76d9c541 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0xd
00000000`0016f7a0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x1d

FOLLOWUP_IP:
mscorwks!DoNDirectCall__PatchGetThreadCall+7b
000007fe`f0bdcd37 41c744240c01000000 mov   dword ptr [r12+0Ch],1
SYMBOL_STACK_INDEX:  2
SYMBOL_NAME:  mscorwks!DoNDirectCall__PatchGetThreadCall+7b
FOLLOWUP_NAME:  MachineOwner
MODULE_NAME: mscorwks
IMAGE_NAME:  mscorwks.dll
DEBUG_FLR_IMAGE_TIMESTAMP:  5265c8ee
STACK_COMMAND:  ~0s ; kb
BUCKET_ID:  X64_HANG_mscorwks!DoNDirectCall__PatchGetThreadCall+7b
FAILURE_BUCKET_ID:  APPLICATION_HANG_cfffffff_mscorwks.dll!DoNDirectCall__PatchGetThreadCall
ANALYSIS_SOURCE:  UM
FAILURE_ID_HASH_STRING:  um:application_hang_cfffffff_mscorwks.dll!dondirectcall__patchgetthreadcall
FAILURE_ID_HASH:  {de6613ac-b0e2-faeb-ba3d-a4a2114c9912}
Followup: MachineOwner

———

After looking at this output I decided I needed to check for threads trying to run away…

0:000> !runaway
User Mode Time
  Thread       Time
   7:1414      0 days 0:00:03.432 <- runaway thread
   0:2390      0 days 0:00:00.156
   6:1dec      0 days 0:00:00.000
   5:cc4       0 days 0:00:00.000
   4:1678      0 days 0:00:00.000
   3:6b4       0 days 0:00:00.000
   2:ce8       0 days 0:00:00.000
   1:1d2c      0 days 0:00:00.000
0:000> ~7s <- make thread 7 active
ntdll!RtlpAllocateHeap+0x327:
00000000`76dc37c8 4889bc24c8000000 mov     qword ptr [rsp+0C8h],rdi ss:00000000`1c18d088=0000000000000001
0:007> kv
Child-SP          RetAddr           : Args to Child                                                           : Call Site
00000000`1c18cfc0 00000000`76dc34d8 : 00000000`1d810000 000007fe`00000002 00000000`00000248 00000000`00000250 : ntdll!RtlpAllocateHeap+0x327
00000000`1c18d560 000007fe`ea5eeb57 : 00000000`00000003 00000000`00000248 00000000`1b75a5b0 00000000`00000800 : ntdll!RtlAllocateHeap+0x16c
00000000`1c18d670 000007fe`ea5ed70f : 00000000`00000248 00000000`1c18deb0 00000000`1d8153c0 00000000`00000000 : vd3d!Vd3dEnableComposition+0x2c117
00000000`1c18d6a0 000007fe`ea55e4eb : 005c0049`00430050 005f004e`00450056 00330035`00380035 00560045`00440026 : vd3d!Vd3dEnableComposition+0x2accf
00000000`1c18d6f0 000007fe`ea568272 : 00300030`005f0056 00370026`0031005c 00440035`67000067 00300026`00370038 : vd3d!OpenAdapter+0x1760b
00000000`1c18d740 000007fe`ea569704 : 00000000`00000003 00000000`1c18dab0 00000000`1c536170 00000000`1c18dd90 : vd3d!OpenAdapter+0x21392
00000000`1c18da30 000007fe`ea56a333 : 00000000`1c18deb0 00000000`1c18de88 00000000`1c18db48 00000000`00000000 : vd3d!OpenAdapter+0x22824
00000000`1c18da80 000007fe`ea56b308 : 00000000`1c18de88 00000000`1c18de88 000007fe`ea77ca28 00000000`00000000 : vd3d!OpenAdapter+0x23453
00000000`1c18dae0 000007fe`ea56d0d0 : 00000000`1c536170 000007fe`ea77ca28 00000000`00000000 00000000`1c536170 : vd3d!OpenAdapter+0x24428
00000000`1c18dde0 000007fe`ea56d879 : 00000000`00000000 00000000`1d815040 000007fe`ea80af36 00000000`1d815060 : vd3d!OpenAdapter+0x261f0
00000000`1c18de60 000007fe`ea546e35 : 00000000`1c18e1c0 00000000`1c18e1c0 00000000`1b7e7018 00000000`00000004 : vd3d!OpenAdapter+0x26999
00000000`1c18df10 000007fe`ea546f17 : 00000000`1c18e1c0 00000000`1c18e1c0 00000000`1b7e7018 00000000`c0000001 : vd3d!Vd3dGetInterface+0x150d5
00000000`1c18e020 000007fe`fa1f9045 : 00000000`1b7e6880 00000000`1d814f80 00000000`00000001 000007fe`ea530000 : vd3d!OpenAdapter+0x37
00000000`1c18e080 000007fe`fa1f8e17 : 00000000`1b7e6880 00000000`00000000 00000000`00000000 00000000`00000001 : d3d9!CreateDeviceLHDDI+0x2a0
00000000`1c18e4f0 000007fe`fa1f72d5 : 00000000`00000048 00000000`1b7e6390 00000000`00000000 00000000`00000000 : d3d9!D3D9CreateDirectDrawObject+0x1ea
00000000`1c18ee70 000007fe`fa1f8974 : 00000000`1b7e6390 00000000`1b7e6390 00000000`00000000 00000000`00000000 : d3d9!FetchDirectDrawData+0x139
00000000`1c18f560 000007fe`fa1f9f58 : 00000000`1b7e1460 00000000`1b7e1460 00000000`00000000 00000000`1b7e1300 : d3d9!InternalDirectDrawCreate+0x282
00000000`1c18f5f0 000007fe`fa1f9d82 : 00000000`00000000 00000000`00000000 00000000`00000001 00000000`1c18fa70 : d3d9!CEnum::CEnum+0x4d6
00000000`1c18f860 00000000`69c71742 : 00000000`00000000 00000000`69d3402b 00000000`1c4904d0 00000000`00000000 : d3d9!Direct3DCreate9Impl+0x2b7
00000000`1c18fa30 00000000`69c7222b : 00000000`00000000 00000000`1c4904d0 00000000`88980006 00000000`00000000 : wpfgfx_v0300!CD3DModuleLoaderInternal::CreateD3DObjects+0xa2
00000000`1c18fa70 00000000`69c71f4a : 00000000`1c4904d0 00000000`1c18fb20 00000000`1c18fb20 00000000`88980006 : wpfgfx_v0300!CDisplaySet::Init+0x1f
00000000`1c18faa0 00000000`69c71d0e : 00000000`00000000 00000000`0000000c 00000000`00000000 00000000`76c8791a : wpfgfx_v0300!CDisplayManager::CreateNewDisplaySet+0x62
00000000`1c18fad0 00000000`69d43e23 : 00000000`00000000 00000000`1b6e6b10 00000000`00000000 00000000`00000006 : wpfgfx_v0300!CDisplayManager::GetDisplaySet+0x9a
00000000`1c18fb20 00000000`69d43ade : 00000000`00000000 00000000`1b71a0c0 00000000`1b6e6af0 00000000`00000000 : wpfgfx_v0300!CMILFactory::GetCurrentDisplaySet+0x53
00000000`1c18fb60 00000000`69c8103a : 00000000`1b71a0c0 00000000`00000000 00000000`00000000 00000000`00000000 : wpfgfx_v0300!CMILFactory::UpdateDisplayState+0x32
00000000`1c18fbc0 00000000`69c8120a : 00000000`00000000 00000000`1b71a0c0 00000000`00000000 00000000`00000000 : wpfgfx_v0300!CComposition::ProcessComposition+0x32
00000000`1c18fc40 00000000`69c76dcc : 00000000`00000000 00000000`1b71a0c0 00000000`00000000 00000000`1b730a10 : wpfgfx_v0300!CComposition::Compose+0x52
00000000`1c18fc70 00000000`69c76f08 : 00000000`1b730a10 00000000`00000000 00000000`1b730a10 00000000`00000000 : wpfgfx_v0300!CPartitionThread::RenderPartition+0x28
00000000`1c18fca0 00000000`69c76ca4 : 00000000`1b71a0c0 00000000`00000000 00000000`00000000 00000000`00000000 : wpfgfx_v0300!CPartitionThread::Run+0x60
00000000`1c18fcd0 00000000`76b6652d : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : wpfgfx_v0300!CPartitionThread::ThreadMain+0x1c
00000000`1c18fd00 00000000`76d9c541 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0xd
00000000`1c18fd30 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x1d
0:007> lmv m vd3d
start             end                 module name
000007fe`ea530000 000007fe`ea83a000   vd3d       (export symbols)       vd3d.dll
    Loaded symbol image file: vd3d.dll
    Image path: C:\Windows\System32\vd3d.dll
    Image name: vd3d.dll
    Timestamp:        Tue Sep 24 08:07:27 2013 (5240BB9F)
    CheckSum:         003020E0
    ImageSize:        0030A000
    File version:     7.1.0.4049
    Product version:  7.1.0.4049
    File flags:       8 (Mask 3F) Private
    File OS:          40004 NT Win32
    File type:        3.4 Driver
    File date:        00000000.00000000
    Translations:     0409.04b0
    CompanyName:      Citrix Systems, Inc.
    ProductName:      Citrix ICA Host
    InternalName:     vd3d.dll
    OriginalFilename: vd3d.dll
    ProductVersion:   7.1
    FileVersion:      7.1.0.4049
    FileDescription:  Citrix WDDM Display Driver
    LegalCopyright:   Copyright 1990-2012 Citrix Systems, Inc.

From the stack we can see Direct3D 9 Runtime results in calls to the Citrix WDDM Display Driver.

The interesting this this display driver shouldn’t exist on thick OS installations, it is designed for Citrix VDI VMs.

This hardware is a physical laptop.

Checking Programs and Features we can see Citrix Virtual Delivery Agent 7.1 is installed. Removing this product, and rebooting machine fixed the hanging issues.

image

About chentiangemalc

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in .NET, Citrix, WinDbg and tagged . Bookmark the permalink.

One Response to Case of the Hung WPF Applications

  1. Akhilesh Saini says:

    Hi chen,

    My wpf application was working fine before installing the below citrix updates on client machine, after installation of below updates application is having hanging problem. I have .net framework 4.5.1 installed on client machine.
    Citrix Director VDA Plugin
    Citrix Group Policy Client-Side Extension 2.4.0.0
    Citrix HDX WS x64 (retail)
    Citrix Hotfix ICAWS760WX64029
    Citrix Hotfix ICAWS760WX64032
    Citrix Monitor Service VDA Plugin
    Citrix Personalization AppV – VDA
    Citrix Profile management
    Citrix Universal Print Client
    Citrix Virtual Delivery Agent 7.6
    Citrix Virtual Desktop Agent – x64
    Citrix WMI Proxy Plugin
    Machine Management WMI Provider

    Can you suggest anything where we are doing mistakes.

    Akhilesh Saini

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s