http://bugs.winehq.org/show_bug.cgi?id=18640
--- Comment #6 from Anastasius Focht focht@gmx.net 2009-05-28 15:07:06 --- Created an attachment (id=21388) --> (http://bugs.winehq.org/attachment.cgi?id=21388) Deadlock between main UI app thread and MILCore renderer thread
Hello,
well it deadlocks between main UI app thread and renderer thread...
--- snip --- ... 0038:trace:d3d9:IDirect3D9Impl_GetAdapterCount 0x172090 0038:trace:d3d9:IDirect3D9Impl_AddRef (0x172090) : AddRef from 2 0038:trace:d3d9:IDirect3D9Impl_GetAdapterCount 0x172090 0038:trace:d3d9:IDirect3D9Impl_GetDeviceCaps (0x172090) Relay 0 1 0x33ce408 0038:trace:d3d9:IDirect3D9Impl_GetDeviceCaps (0x172090) returning 0x33ce408 0038:trace:d3d9:IDirect3D9Impl_CheckDeviceType (0x172090)->(0, 1, 22, 22, true 0038:trace:d3d9:IDirect3D9Impl_QueryInterface Returning IDirect3D9Ex interface at 0x172090 0038:trace:d3d9:IDirect3D9Impl_AddRef (0x172090) : AddRef from 3 0038:warn:d3d9:IDirect3D9Impl_QueryInterface (0x172090)->({02177241-69fc-400c-8ff1-93a44df6861d},0x33ce52c),not found 0038:trace:d3d9:IDirect3D9Impl_CreateDevice (0x172090) Relay 0038:trace:d3d9:IDirect3D9Impl_GetAdapterCount 0x172090 0038:trace:d3d9:device_parent_WineD3DDeviceCreated iface 0x17eadc, device 0x1cb800 0038:trace:d3d9:IDirect3D9Impl_CreateDevice (0x172090) : Created Device 0x17ead8 0038:trace:d3d9:device_parent_CreateSwapChain iface 0x17eadc, present_parameters 0x1940f8, swapchain 0x33ce14c 0038:trace:d3d9:IDirect3DDevice9Impl_CreateAdditionalSwapChain (0x17ead8) Relay 0038:trace:d3d9:device_parent_CreateRenderTarget iface 0x17eadc, superior 0x194d98, width 1, height 1, format 0x3, multisample_type 0, multisample_quality 0, lockable 1, surface 0x1dd6dc 0038:trace:d3d9:IDirect3DDevice9Impl_CreateRenderTarget Relay 0038:trace:d3d9:IDirect3DDevice9Impl_CreateSurface (0x17ead8) Relay 0038:trace:d3d9:IDirect3DDevice9Impl_CreateSurface (0x17ead8) : w(1) h(1) fmt(22) surf@0x787096b4 0038:trace:d3d9:IDirect3DDevice9Impl_AddRef (0x17ead8) : AddRef from 1 0038:trace:d3d9:IDirect3DDevice9Impl_CreateSurface (0x17ead8) : Created surface 0x194db8 0038:trace:d3d9:IDirect3DSurface9Impl_Release (0x194db8) 0038:trace:d3d9:IDirect3DSurface9Impl_Release (0x194db8) : ReleaseRef to 0 0038:trace:d3d9:IDirect3DDevice9Impl_Release (0x17ead8) : ReleaseRef to 1 0038:fixme:d3d:WineD3D_ChoosePixelFormat Add OpenGL context recreation support to SetDepthStencilSurface <hang here> --- snip ---
I attached the backtrace of relevant threads at the time of the deadlock. NOTE: the console snippet from above and winedbg backtraces are from different runs (different TIDs).
The interesting ones are: thread 0022 (UI thread) vs. thread 0033 (renderer thread) I talked about in comment #2
thread 0022:
Looks like the managed UI main app thread which synchronously waits for command to be completed - signaled using event from renderer thread I think.
thread 0033:
The renderer thread. When the d3d9 device is created, the window handle created by main UI thread is passed. The pixel format is propagated synchronously to target window. Because the target (thread 0022) waits for event without pumping messages it deadlocks.
Regards