https://bugs.winehq.org/show_bug.cgi?id=40414
Bug ID: 40414 Summary: VirtualDub 1.10.4 crashes when attempting to play video with Directx9/11 backend Product: Wine Version: 1.9.7 Hardware: x86 URL: https://sourceforge.net/projects/virtualdub/files/virt ualdub-win/1.10.4.35491/VirtualDub-1.10.4.zip/download OS: Mac OS X Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: 00cpxxx@gmail.com
I'm aware that DirectX10/11 is being built. This is just to report the problem and ensure we have some programs to test aside from close sourced paid games.
To reproduce open VritualDub and then Option->Preferences->Display. The "Use DirectX for display panes" will be already selected so just tick the "Use Direct3D 9/11 (EXPERIMENTAL)" feature. Now try to open a video and play file supported by our codecs.
Sample video file (˜600kb): https://samples.mplayerhq.hu/V-codecs/CVID/lisa.avi
fixme:dxgi:DXGID3D10CreateDevice Ignoring flags. fixme:dxgi:dxgi_check_feature_level_support Ignoring adapter type. fixme:dxgi:dxgi_device_init Ignoring adapter type. fixme:d3d11:device_parent_create_swapchain_texture device_parent 0x1a9bec, container_parent 0x191818, wined3d_desc 0x32cb38, wined3d_texture 0x19ac08 partial stub! fixme:d3d11:device_parent_create_swapchain_texture Implement DXGI<->wined3d usage conversion. wine: Unhandled page fault on write access to 0x00000000 at address 0x49f7e490 (thread 0035), starting debugger... Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x49f7e490). ... Backtrace: =>0 0x49d96490 _d3d11_device_CreateQuery+0x110() in d3d11 (0x0032d3d8) 0x49d96490 _d3d11_device_CreateQuery+0x110 in d3d11: movl %eax,0x0(%ecx)
It is important to run "VirtualDub.exe /h" to disable its internal crash handler.
It is hard to tell if something similar is already reported, if it is please take my apologies in advance.
https://bugs.winehq.org/show_bug.cgi?id=40414
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- Could you attach d3d11 log too please?
https://bugs.winehq.org/show_bug.cgi?id=40414
--- Comment #2 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 54154 --> https://bugs.winehq.org/attachment.cgi?id=54154 +d3d11,+tid,+seh
https://bugs.winehq.org/show_bug.cgi?id=40414
--- Comment #3 from Henri Verbeet hverbeet@gmail.com --- (In reply to Bruno Jesus from comment #2)
0044:trace:d3d11:d3d11_device_CreateQuery iface 0x1be1d0, desc 0x32d3f4, query 0x0.
Looks like it passes NULL as "query" argument to d3d11_device_CreateQuery(). That's suspicious, but perhaps we just need to return an error for that case.
https://bugs.winehq.org/show_bug.cgi?id=40414
--- Comment #4 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Henri Verbeet from comment #3)
(In reply to Bruno Jesus from comment #2)
0044:trace:d3d11:d3d11_device_CreateQuery iface 0x1be1d0, desc 0x32d3f4, query 0x0.
Looks like it passes NULL as "query" argument to d3d11_device_CreateQuery(). That's suspicious, but perhaps we just need to return an error for that case.
Indeed, the following hack makes the app happy:
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4e84dad..d6b06b1 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2482,7 +2482,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device *iface, HRESULT hr;
TRACE("iface %p, desc %p, query %p.\n", iface, desc, query); - +if(!query) return S_OK; if (FAILED(hr = d3d_query_create(device, desc, FALSE, &object))) return hr;
https://bugs.winehq.org/show_bug.cgi?id=40414
--- Comment #5 from Nikolay Sivov bunglehead@gmail.com ---
From their sources:
--- void VDTFenceManagerD3D11::Init(ID3D11Device *dev, ID3D11DeviceContext *devctx) { D3D11_QUERY_DESC desc; desc.Query = D3D11_QUERY_EVENT; desc.MiscFlags = 0; HRESULT hr = dev->CreateQuery(&desc, NULL);
mpD3DDevice = dev; mpD3DDevice->AddRef(); mpD3DDeviceContext = devctx; mpD3DDeviceContext ->AddRef();
mFirstFenceId = 1; mNextFenceId = 1; } ---
So for this particular application return code does not affect anything. However in d3d9 case similar call is used to set 'mbEventQueriesSupported' variable. Our d3d9 CreateQuery() method handles NULL out pointer fine, and it's not an error. D3D11 docs agree too, calling it an optional parameter.
https://bugs.winehq.org/show_bug.cgi?id=40414
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |directx-d3d
https://bugs.winehq.org/show_bug.cgi?id=40414
--- Comment #6 from Nikolay Sivov bunglehead@gmail.com --- Created attachment 54155 --> https://bugs.winehq.org/attachment.cgi?id=54155 patch
Fix for a crash using a pattern d3d9 uses.
https://bugs.winehq.org/show_bug.cgi?id=40414
--- Comment #7 from Henri Verbeet hverbeet@gmail.com --- Yeah, that makes sense. Still needs tests, of course. There's test_create_predicate() in the d3d10core tests for predicates, but queries should be very similar.
https://bugs.winehq.org/show_bug.cgi?id=40414
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, patch, source
https://bugs.winehq.org/show_bug.cgi?id=40414
Józef Kucia joseph.kucia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |joseph.kucia@gmail.com
--- Comment #8 from Józef Kucia joseph.kucia@gmail.com --- Created attachment 54156 --> https://bugs.winehq.org/attachment.cgi?id=54156 A test for CreateQuery()
(In reply to Nikolay Sivov from comment #6)
Created attachment 54155 [details] patch
Fix for a crash using a pattern d3d9 uses.
It probably needs a few todo_wine. Feel free to submit it together with your fix.
https://bugs.winehq.org/show_bug.cgi?id=40414
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |72e079d7a6c3c2a1d61b90c9427 | |516db4d451684 Resolution|--- |FIXED
--- Comment #9 from Bruno Jesus 00cpxxx@gmail.com --- Thanks everybody, I wish we have more simple bugs like this in the future.
http://source.winehq.org/git/wine.git/?a=commit;h=72e079d7a6c3c2a1d61b90c942...
https://bugs.winehq.org/show_bug.cgi?id=40414
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.8.