-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Crash on exit with hwdec=d3d11va after b46eaa3 #3348
Comments
Is this with HEVC on Intel? I can't reproduce with h264, but I know there are weird HEVC issues, for which I'm blaming the drivers. |
Codec doesn't matter, happens always when hardware decoding is used. nVidia 660. |
Not sure if it's related, but I had consistent crashes on exit until I updated my drivers (from 368.39 to 368.69.) I can't remember if d3d11va was involved or not. |
I have latest driver version 368.81. |
Also note that if you run mpv not from command line it will crash silently, you won't see "mpv has stopped working" message. |
Still crashes on a fresh Windows installation with a latest drivers and mpv. There is a message "mpv has stopped working" now even if mpv wasn't started from command line. |
Btw I can repro this consistently now. For some reason, the error reporting dialog doesn't show when I launch mpv normally and then close it, but a werfault.exe process will appear briefly in the task manager. When I launch mpv in a debugger, play some video with hwdec=d3d11va and close it, it will almost always crash with an EXCEPTION_ACCESS_VIOLATION. It always happens after d3d11.dll is unloaded. When decoding with hwdec_d3d11egl, only ANGLE has a reference to d3d11.dll, so d3d11.dll is unloaded when ANGLE calls FreeLibrary. It seems like a thread owned by the Nvidia driver (nvwgf2umx.dll) tries to call functions in d3d11.dll after it's unloaded (RIP is set to an address where d3d11.dll used to be.) I have no idea why this is happening though. If hwdec uninit happens before vo uninit, ANGLE's reference to d3d11.dll should still be alive while any hwdec-related objects are alive. That said, we might be able to fix this by calling d3d_load_dlls() in all cases, even when only ANGLE has to call into d3d11.dll directly. That way, d3d11.dll will never be unloaded. |
Sounds good enough. |
At least with Nvidia drivers, some thread tries to access D3D11 objects after ANGLE unloads d3d11.dll. Fix this by holding a reference to d3d11.dll ourselves. Might fix the crash in mpv-player#3348. (I wish I knew why though.)
At least with Nvidia drivers, some thread tries to access D3D11 objects after ANGLE unloads d3d11.dll. Fix this by holding a reference to d3d11.dll ourselves. Might fix the crash in #3348. (I wish I knew why though.)
Seems fixed. |
mpv version and platform
mpv git-77e1e8e Win 10
Reproduction steps
Open any h.264 video from command line with --hwdec=d3d11va option
Expected behavior
No errors after mpv shut down
Actual behavior
There is a message "mpv has stopped working"
Log files
From Administrative Events:
The text was updated successfully, but these errors were encountered: