User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Unity Unresponsive

13 Mar 2019, 19:30

About 10% of time when I edit Noesis XAML external to Unity, and then return to Unity I find that Unity is unresponsive. It does not respond to mouse or keyboard interaction and I can't get it back. I have tried waiting long periods of time (5+ minutes) and I have also used a variety of methods (alt-tab, ctrl+d to show desktop, etc) to try to regain focus. Unity repaints but it does not respond to input. The only option I am left with is killing Unity from the task manager and then my XAML changes are recompiled on the next start of Unity. This has happened to me perhaps fifteen times since the behavior first started a few days ago. It happened with 2.2.0b6 and after upgrading, I am seeing it with rc1.

So that I can help file a bug that is actionable... Is there a log file that I should look in to provide more useful telemetry to you for development purposes? I am including a link to my editor_log file (https://bit.ly/2F9DAIl) Other than a XAML compile error I was working to resolve -- I'm not sure that I did anything crazy.
Last edited by stonstad on 26 Mar 2019, 23:59, edited 2 times in total.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Unity Unresponsive

13 Mar 2019, 19:48

Yes, please, go to NoesisSettings panel and enable 'Debug Importer'. That should provide extra information that can help us. Thanks!
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Unity Unresponsive

13 Mar 2019, 20:47

Done -- I'll report back once it happens.

FYI -- the Noesis XAML importer (and least in debug mode) does not respect the "Script Changes While Playing setting in Unity" setting, which I have set to "Recompile After Finished Playing".

Image

I have this disabled for my Unity project because I have static initializers which are not reentrant (see https://forum.unity.com/threads/static- ... or.615154/). While playback is happening -- if I edit XAML it seems to force recompilation which blows away state in my static initializers and causes quite a few runtime errors in my project. Although I noramly don't edit while playback is underway, maybe these two behaviors are related.
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Unity Unresponsive

13 Mar 2019, 21:59

Link: https://bit.ly/2EXgu6r

This is where it stopped. Unity editor process says, "Not Responding" in task manager and CPU is 0%. So when I said input was disabled -- this is incorrect. This is with debug on, and verbose set to normal.
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Unity Unresponsive

13 Mar 2019, 22:01

Also of note -- it happens FAR less often with debug on. Assuming that is a true statement (who knows...) it feels like a threading or race issue since it is a) random, and b) less frequent with increasing logging (i.e. longer duration between contentious method invocation...) I don't think this behavior is causing a crash dump.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Unity Unresponsive

14 Mar 2019, 00:34

Thanks for the logs! Analyzing the last one you attached:
← Import assets
UnityEngine.DebugLogHandler:Internal_Log()
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
NoesisPostprocessor:Log(String) (at Assets\NoesisGUI\Plugins\Editor\NoesisPostprocessor.cs:398)
NoesisPostprocessor:ImportAssets(String[], UpdateProgress) (at Assets\NoesisGUI\Plugins\Editor\NoesisPostprocessor.cs:91)
<>c__DisplayClass4_1:<OnPostprocessAllAssets>b__0() (at Assets\NoesisGUI\Plugins\Editor\NoesisPostprocessor.cs:107)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:200)
 
(Filename: Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs Line: 398)

<RI> Initialized touch support.

Reloading assemblies for play mode.
Begin MonoManager ReloadAssembly
It seems that Noesis already finished importing everything and that the hang is happening when reloading Mono. If you attach a debugger to Unity when it is locked, can you see in which module is Unity stopped and tell me?
I have this disabled for my Unity project because I have static initializers which are not reentrant (see https://forum.unity.com/threads/static- ... or.615154/). While playback is happening -- if I edit XAML it seems to force recompilation which blows away state in my static initializers and causes quite a few runtime errors in my project. Although I noramly don't edit while playback is underway, maybe these two behaviors are related.
Effectively in the logs it seems that changes are happening while in Play mode. I am not sure how our AssetPostProcessor can change the way scripts are being imported because we only import XAML and Fonts. First time I know about that option, I will investigate about it.
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Unity Unresponsive

26 Mar 2019, 17:00

jsantos, I haven't debugged Unity yet. It happens ... seemingly at random and I don't have a debugger attached consistently. I am wondering if it is related to this: https://issuetracker.unity3d.com/issues ... 1539797410

I just upgraded to 2018.3.10f1 and even though this fix was for Mac, I'll be watching to see if it continues to manifest.
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Unity Unresponsive

26 Mar 2019, 21:34

After upgrading to Unity 2018.3.10f I'm seeing TCP/IP timeout errors with my web services and this is the likely culprit of editor timeouts. Vindication for Noesis! Thank you for working with me as I tried to understand the behavior.

The sequence of events is...

1) Edit some Noesis XAML external to the Unity editor
2) Focus the editor and watch as Noesis XAML and resources reload without error.
3) Editor cannot be focused and interaction is disabled.

But there was a hidden 2.5 step in there, which relates to in-memory state of my web services. So Something about that code is non-reentrant. Unity 2018.3.10f is reporting the behavior whereas previously it was somehow masked.
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Unity Unresponsive

27 Mar 2019, 00:03

I have to unfortunately backtrack on my prior statement. I was certain I found the cause because it makes sense. I have learned the web service can cause editor delays -- but these delays are limited to the maximum duration the socket is permitted to stay open (1 minute).

The original problem described above is still happening. I attached the VS debugger and from what I can tell, the main thread holding here:

Image

This is Noesis v2.20rc1.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Unity Unresponsive

27 Mar 2019, 00:30

At that breakpoint could you please generate a dump (Debug->Save Dump As...) and attach it to a report? Let's see what's going on there.

Who is online

Users browsing this forum: Bing [Bot] and 87 guests