uDesktopDuplication icon indicating copy to clipboard operation
uDesktopDuplication copied to clipboard

Unity editor Crash

Open jimmythepage opened this issue 7 years ago • 11 comments

Greetings,

first of all thank very much you for sharing uDesktopDuplication. I cannot manage to use this asset. Whenever I hit play on Unity, the editor freezes and after a while crashes. I have Windows 8.1, Intel i7 6800, geforce 980 and I have tried on Unity 5.5.0f3 and 5.4.3f1.

Also, after the first crash Unity 5.5 decreased all the editor fonts (very strange behaviour).

Many thanks in advance.

jimmythepage avatar Jan 10 '17 15:01 jimmythepage

Thanks for the reporting. Could you give me uDesktopDuplication.log? It is output in the same directory as Assets directory.

hecomi avatar Jan 10 '17 15:01 hecomi

Hi Hecomi, Thanks for the Package. I crashed in editor almost every time i ended playmode. attatched if my uDesktopDuplication log and error log. uDesktopDuplication.log error.log

wyattdesouza avatar Nov 15 '17 06:11 wyattdesouza

I have encountered a similar issue on Windows 8.1 with a GTX 1080 in Unity 2018.1.1f1. Hitting play in the editor with any of the example scenes causes Unity to freeze. I have to close and reopen it. I also encounter this freezing issue in player builds of another application.

In an attempt to track down the issue, I have tried out older versions. With v1.4.2 it still works. With the commit f6ce875463fe6da3c8e15510dc1fdac2fd3f0700 right afterwards it still works. Starting with 741e2c0bc1b792c19ce707f692358e84dcdc65c6 I encounter these freezes.

Here is my uDesktopDuplication.log file:

[uDD::Log][2018-11-24 18:07:48] Start
[uDD::Log][2018-11-24 18:07:48] Monitor::Initialize() => OK.
[uDD::Log][2018-11-24 18:07:48]     ID    : 0
[uDD::Log][2018-11-24 18:07:48]     Size  : (1920, 1080)
[uDD::Log][2018-11-24 18:07:48]     DPI   : (91, 91)
[uDD::Log][2018-11-24 18:07:48]     Rot   : Landscape
[uDD::Log][2018-11-24 18:07:54] Stop

There is no error.log.

emilianavt avatar Nov 24 '18 17:11 emilianavt

Thanks for providing very helpful information! I'll check the commit 741e2c0bc1b792c19ce707f692358e84dcdc65c6.

hecomi avatar Nov 26 '18 14:11 hecomi

I was not able to generate the freeze in my environment..., so if possible, could you try the debug like below in your environment?

  1. Download the repository (https://github.com/hecomi/uDesktopDuplication/archive/master.zip).
  2. Unzip it.
  3. Open the project by Unity.
  4. Open uDesktopDuplication/Plugins/uDesktopDuplication.sln by Visual Studio.
  5. Open the "Attach to Process" window in VS (Fig. 1)
  6. Find Unity which opens the project (Fig. 2)
  7. Press "Attach" button
  8. Press the run (▶) button in Unity.

If No. 8 causes a breakpoint, please tell me the line number of it. Otherwise, please press the pause button in VS to pause the process manually, and let me know the line where the freeze occurs.

Fig. 1 fig1

Fig. 2 2018-11-29 1

hecomi avatar Nov 28 '18 16:11 hecomi

Thank you very much for the detailed instructions!

I followed them step by step. However, the debugger did not stop at a breakpoint or exception and pausing did not give any useful results. Depending on when I pressed pause, it would be in the Mono garbage collector or ntdll.dll. Here are some example call stacks.

It seems execution does not completely freeze. The Unity window remains completely unresponsive, although the mouse cursor still changes when right clicking in the scene view. 'Profiler' and 'Stats' do not update.

One thing that might help is that I got a lot of output in Visual Studio's 'Output' window. While Unity appears frozen, the final assertion failure message keeps repeating.

I also tried building the DLL myself and copying it and the pdb file to the assets directory. The output looked pretty much the same.

In comparison, when pressing play in an empty scene, everything works as expected and there is no further output in the debugger after what is line 38 in the gist:

Load scene 'Temp/__Backupscenes/0.backup' time: 0.362400 ms 

emilianavt avatar Nov 28 '18 20:11 emilianavt

Another thing I have noticed is that Update() keeps getting called. Apparently Unity is still running, it just becomes unable to update the screen or process user input other than closing the window.

emilianavt avatar Nov 30 '18 20:11 emilianavt

Thank you very much for the detailed report. They are very helpful but I've not been able to find any solution yet..., so I'll create a new unitypackage that includes debug version of DLL with various log outputs.

hecomi avatar Dec 04 '18 15:12 hecomi

I released v1.5.7 a few minutes ago which outputs debug logs. Could you run the debug version (uDesktopDuplication-v1.5.7-debug.unitypackage) in your environment and give me uDekstopDuplication.log when you have a time?

hecomi avatar Dec 08 '18 04:12 hecomi

Thank you for keeping up trying to solve this strange issue! I've run the debug build now. Since the log got very long, I cut out the middle, but kept the first few seconds and last second before closing Unity.

https://gist.github.com/emilianavt/cfaaa0380301b2ab387e293b1c52753f

The main odd thing I see is that it apparently detected a second graphics card with a dummy driver.

emilianavt avatar Dec 08 '18 10:12 emilianavt

Thanks for providing the log!

Microsoft Basic Render Driver is detected also in my environment. So I think this is not related to this bug.

The C++ side seemed to work without any error..., and some lines like Monitor::Render said that some APIs were successfully called from the Unity side. So I'm now thinking it's the best way to run the same steps as https://github.com/hecomi/uDesktopDuplication/commit/f6ce875463fe6da3c8e15510dc1fdac2fd3f0700 and check the difference between the current code and it. I'll prepare a version that includes this so please give me more time to do it.

hecomi avatar Dec 11 '18 00:12 hecomi