uWindowCapture icon indicating copy to clipboard operation
uWindowCapture copied to clipboard

UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported crash

Open Curtis-VL opened this issue 3 years ago • 9 comments

Hi Hecomi,

Loving the new update, Windows.Graphics.Capture is great!

Though I have found a crash: 0x00007FFF29546122 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFF29539287) 0x00007FFF29539287 (uWindowCapture) (function-name not available) 0x00007FFF2953D8F7 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported 0x00007FFF2953DC17 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported 0x00007FFF29570210 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported 0x00007FFF479053FE (KERNEL32) BaseThreadInitThunk 0x00007FFF496A590B (ntdll) RtlUserThreadStart

This same system also returned 'Unsupported' for all displays by uDesktopDuplication, so I assume all their displays are off their main GPU.

They are on Windows 10 version 2004 or later, Windows.Graphics.Capture is supported by the OS version at least.

Curtis-VL avatar May 01 '21 18:05 Curtis-VL

Hi Curtis, thank you for the information! I happen to have one laptop PC without a discrete GPU that I can use for the investigation, so I'll try it out on that.

hecomi avatar May 03 '21 04:05 hecomi

Hi Hecomi,

That's great, let me know if you need any further information or would like me to test with the user who found the issue!

Curtis-VL avatar May 03 '21 05:05 Curtis-VL

I was unable to reproduce this crash on my laptops (1909 / 1903)... However, I am guessing that GraphicsCaptureSession::IsSupported() might be the cause of this crash, so could you try this .unitypackage with this code modified? uWindowCapture-v1.0.2.temp.zip

hecomi avatar May 03 '21 17:05 hecomi

I will try this now, thanks!

Curtis-VL avatar May 03 '21 18:05 Curtis-VL

That seems to have fixed the crash this user was experiencing, thank you!

Curtis-VL avatar May 03 '21 19:05 Curtis-VL

Hi Hecomi,

That same user just reported another crash that seems to be related to the same method, though it could just be a coincidence. Stack trace is as follows:

Fallback handler could not load library D:/Steam/steamapps/common/OVR Toolkit/OVR Toolkit_Data/Mono/libc

  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFC693AF2F2)
0x00007FFC693AF2F2 (d3d11) (function-name not available)

  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFC693AA62F)
0x00007FFC693AA62F (d3d11) (function-name not available)

Fallback handler could not load library D:/Steam/steamapps/common/OVR Toolkit/OVR Toolkit_Data/Mono/libc.dll

Fallback handler could not load library D:/Steam/steamapps/common/OVR Toolkit/OVR Toolkit_Data/Mono/libc

0x00007FFBFCC067C1 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFBFCBF97C3)

0x00007FFBFCBF97C3 (uWindowCapture) (function-name not available)

0x00007FFBFCBFDF77 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported

0x00007FFBFCBFE297 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported

0x00007FFBFCC30F50 (uWindowCapture) UwcIsWindowsGraphicsCaptureCursorCaptureEnabledApiSupported

Fallback handler could not load library D:/Steam/steamapps/common/OVR Toolkit/OVR Toolkit_Data/Mono/libc

Fallback handler could not load library D:/Steam/steamapps/common/OVR Toolkit/OVR Toolkit_Data/Mono/libc.dll
0x00007FFC6DA453FE (KERNEL32) BaseThreadInitThunk

Fallback handler could not load library D:/Steam/steamapps/common/OVR Toolkit/OVR Toolkit_Data/Mono/libc
0x00007FFC6E52590B (ntdll) RtlUserThreadStart

So far I have not heard of this crash from other users, however, there aren't many in my testing team who have no monitors on the main GPU. They did report that with the crash fix (v1.0.2-temp) Windows.Graphics.Capture is working as intended, the yellow borders show around windows to confirm this.

This appears to have happened upon activating the window GameObject.

Curtis-VL avatar May 04 '21 19:05 Curtis-VL

Could you please try again with v1.0.2?

hecomi avatar May 08 '21 13:05 hecomi

I am having the user try the new build, I will let you know in a few days!

Curtis-VL avatar May 08 '21 22:05 Curtis-VL

Hello, This error is still occuring on v1.1.2 and latest commit. windows 10 version 21H2, Unity 2021.2.6 To reproduce it :

  • pull the latest commit and go to the window list scene
  • have a minimum of 10 application window opened (the more there are, the more frequently the bug will occur)
  • Hit play and activate / deactivate the windows streaming for some of them a little.
  • after 15-20 seconds, stop the scene and repeat last step until Unity crashes.

It seem that by disabling the cursor, getting the errors of the dll on unity log, capping the streaming at 20fps and using the PrintWindow method for streaming , there is less crashes.

thomasLopvetVR avatar Apr 17 '23 11:04 thomasLopvetVR