Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown crash after storing private references to context shaders #3169

Closed
rlocatti-nv opened this issue Jan 5, 2023 · 2 comments
Closed
Labels

Comments

@rlocatti-nv
Copy link

Starting with commit 8758bce a few applications started crashing on shutdown inside RtlAcquireSRWLockExclusive. Reverting this commit fixes the issue.

Here is a backtrace of the crash:

 	ntdll.dll!RtlAcquireSRWLockExclusive()	Unknown
>	[Inline Frame] d3d11.dll!dxvk::mutex::lock() Line 182	C++
 	[Inline Frame] d3d11.dll!std::lock_guard<dxvk::mutex>::{ctor}(dxvk::mutex &) Line 427	C++
 	[Inline Frame] d3d11.dll!dxvk::DxvkMemoryAllocator::free(const dxvk::DxvkMemory &) Line 443	C++
 	d3d11.dll!dxvk::DxvkMemory::free() Line 56	C++
 	d3d11.dll!dxvk::DxvkMemory::~DxvkMemory() Line 50	C++
 	d3d11.dll!dxvk::DxvkImage::`scalar deleting destructor'(unsigned int)	C++
 	[Inline Frame] d3d11.dll!dxvk::D3D11Texture2D::{dtor}() Line 1175	C++
 	d3d11.dll!dxvk::D3D11Texture2D::`scalar deleting destructor'(unsigned int)	C++
 	[Inline Frame] d3d11.dll!dxvk::ComObject<ID3D11Texture2D1>::ReleasePrivate() Line 67	C++
 	d3d11.dll!dxvk::D3D11Texture2D::Release() Line 1203	C++
 	Ashes_DX11.exe!...()	Unknown

Software information

Reproduced on an internal Ashes of the Singularity frame capture. It also happens on other titles.
I can try reproducing it in a real application if the bug is not obvious.

System information

  • GPU: NVIDIA GeForce RTX 3060 Ti
  • Driver: 527.56.0
  • Wine version: Windows 11
  • DXVK version: f94b42f

Log files

@Blisto91
Copy link
Contributor

Blisto91 commented Jan 5, 2023

Hello.
If possible could you attempt to record a apitrace of a section of the game where it usually crashes? Do it without dxvk.
https://github.com/doitsujin/dxvk/wiki/Using-Apitrace

If not then i will try to test the game myself on Linux tomorrow.

Edit: oh didn't notice it was you Rodrigo 😁

@doitsujin
Copy link
Owner

doitsujin commented Jan 5, 2023

The reason why we don't crash without that commit is most likely because we're straight-up leaking the D3D11 device.

What exactly is happening anyway? This sounds like the underlying DXVK device already got destroyed by the time the texture gets destroyed (which however should hold a strong reference to the D3D11 device), so this should be impossible, not sure what to make of this.

Either way, yes, COM reference counting is known to be extremely broken in DXVK, but it's also extremely hard to get right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants