https://bugs.winehq.org/show_bug.cgi?id=51103
Bug ID: 51103 Summary: d3d11:d3d11 crashes on Windows + NVidia Product: Wine Version: unspecified Hardware: x86-64 OS: Windows Status: NEW Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
Created attachment 69968 --> https://bugs.winehq.org/attachment.cgi?id=69968 Traces for the crash on cw-gtx560
d3d11:d3d11 crashes on the cw-gtx560 machine which has an NVidia graphics card. The crash happens from Windows 8.1 to Windows 10 2009 so it seems to be related to the graphics driver rather than to the Windows version.
https://test.winehq.org/data/patterns.html#d3d11:d3d11
The crash shows no backtrace but I added traces and found that the crash happens on the final release in test_device_context_state():
refcount = ID3D11Device1_Release(device);
Adding a trace on the previous line shows that the refcount before that call is 1. So it's not a case of a one-too-many release calls.
Without test_device_context_state() d3d11:d3d11 does not crash. According to a bisect the commit causing this crash is:
commit ccffc06c6df30aa8b4ea487b868c419b9c7f5a9a Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Feb 2 16:41:00 2021 +0100
d3d11/tests: Add more tests for ID3D11DeviceContext1_SwapDeviceContextState.
Better checking multiple context swap side effects.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=51103
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |ccffc06c6df30aa8b4ea487b868 | |c419b9c7f5a9a Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=51103
--- Comment #1 from François Gouget fgouget@codeweavers.com --- Further investigation shows that the crash happens in a thread which never called winetest_set_location(). Maybe that's a Direct3D / driver thread. And this is why the test framework does not show the line number of the last trace.
Also right after the crash a Windows notification saying that "Display driver stopped responding has recovered" pops up (this is with the Game Ready Driver 391.35).
https://bugs.winehq.org/show_bug.cgi?id=51103
--- Comment #2 from François Gouget fgouget@codeweavers.com --- Some more notes: * The crash still happens even if all the other tests are commented out (and obviously also if WINETEST_NO_MT_D3D=1). * The latest driver for the GeForce GTX 560 seems to be the 391.35 driver which was released on 2018-03-27.
https://bugs.winehq.org/show_bug.cgi?id=51103
Stefan Dösinger stefan@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stefan@codeweavers.com
--- Comment #3 from Stefan Dösinger stefan@codeweavers.com --- I am looking into this, I can reproduce it locally on a Nvidia Windows box - 650M, 425.31 driver from 2019.
I am convinced that the cross-device state swapping tests are causing the problem. It is not as simple as creating two devices, one ContextState and and assigning it. This doesn't crash, not even if the initial state of device1 is assigned to device2 on destruction. The actual content of the state seems to matter too, but I haven't narrowed it down further yet.
https://bugs.winehq.org/show_bug.cgi?id=51103
--- Comment #4 from Stefan Dösinger stefan@codeweavers.com --- Created attachment 71655 --> https://bugs.winehq.org/attachment.cgi?id=71655 Use integer state instead of bound objects for cross-device state tests
So the problem isn't the state object, the problem is that we are using vertex shaders across two devices. I could salvage most of the test by using the primitive topology setting instead of the bound vertex shader. This way things pass on Nvidia without crashing.
However, the test result is somewhat different in at least one test. A state that was set in context1 now applies to context2. Also there seems to be a huge reference leak in the same situation. That reference leak also happens on other HW on Windows. Maybe this "feature" we are testing here is just a bug?
https://bugs.winehq.org/show_bug.cgi?id=51103
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |36d206008cc0631a6f8e58aa2c9 | |463a4ede54f93 Status|NEW |RESOLVED
--- Comment #5 from François Gouget fgouget@codeweavers.com --- cw-gtx560 still gets 19 failures (which is better than cw-rx460), but at least it does not crash anymore. So that's good. The crash got fixed by the commit below:
commit 36d206008cc0631a6f8e58aa2c9463a4ede54f93 Author: Stefan Dösinger stefan@codeweavers.com Date: Mon Jan 17 23:22:00 2022 +0300
d3d11/tests: Disable cross-device ContextState tests.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51103 Signed-off-by: Stefan Dösinger stefan@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
As far as I can tell the remaining failures were being masked by the crash and a cursory look does not indicate that they are related in any way (different part of the test). So we may need to open new bugs for them but I think this one can be closed.
https://bugs.winehq.org/show_bug.cgi?id=51103
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.3.