Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity Locks up on script recompile

Discussion in 'Editor & General Support' started by SentreStage, Aug 12, 2013.

  1. SentreStage

    SentreStage

    Joined:
    Aug 8, 2011
    Posts:
    25
    Hey all,

    Been fighting with this for the last 10 hours. A project that I have been working on for a little over a year has suddenly just started causing Unity to stop responding every time it attempts to recompile the scripts when I make a change.

    I've tried deleting all of the Monodevelop .sln files and csvproj files, even the Temp folder, and the Library folder; and forcing Unity to rebuild those.. thinking maybe something was wrong with the cache somewhere or something.

    I'm running Unity version 3.5.7f6 with Pro and iPhone Pro licenses. I get this same crash both on Windows 7 Premium (64x) and Mac OSX Lion 10.7. All of my other projects open and run just fine so I know its not an issue with Unity itself. It's something with this project.

    Here's what the editor log is showing on my Macbook Pro with NO code changes, but trying to enter Play Mode for the second time:

    Code (csharp):
    1.  
    2. Refresh, detecting if any assets need to be imported or removed ... 1.820909 seconds (Nothing changed)
    3. Begin MonoManager ReloadAssembly
    4. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll (this message is harmless)
    5. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll (this message is harmless)
    6. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll (this message is harmless)
    7. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll into Unity Child Domain
    8. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-CSharp.dll (this message is harmless)
    9. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-CSharp.dll into Unity Child Domain
    10. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll (this message is harmless)
    11. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll into Unity Child Domain
    12. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll (this message is harmless)
    13. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll into Unity Child Domain
    14. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-UnityScript.dll (this message is harmless)
    15. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-UnityScript.dll into Unity Child Domain
    16. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-UnityScript-Editor-firstpass.dll (this message is harmless)
    17. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Library/ScriptAssemblies/Assembly-UnityScript-Editor-firstpass.dll into Unity Child Domain
    18. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/EasyMotion2D/Editor/EasyMotion2D.Editor.dll (this message is harmless)
    19. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/EasyMotion2D/Editor/EasyMotion2D.Editor.dll into Unity Child Domain
    20. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/EasyMotion2D/Runtime/EasyMotion2D.Runtime.dll (this message is harmless)
    21. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/EasyMotion2D/Runtime/EasyMotion2D.Runtime.dll into Unity Child Domain
    22. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/Editor/Prime31/P31MenuItem.dll (this message is harmless)
    23. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/Editor/Prime31/P31MenuItem.dll into Unity Child Domain
    24. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/ex2D/Core/ex2D.Runtime.dll (this message is harmless)
    25. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/ex2D/Core/ex2D.Runtime.dll into Unity Child Domain
    26. Non platform assembly: /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/ex2D/Editor/ex2D.Editor.dll (this message is harmless)
    27. Loading /Users/keithbrewer/Documents/Projects/Production-July2013/trunk/Assets/ex2D/Editor/ex2D.Editor.dll into Unity Child Domain
    28. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/System.Core.dll (this message is harmless)
    29. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/System.dll (this message is harmless)
    30. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/UnityScript.dll (this message is harmless)
    31. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/Mono.Cecil.dll (this message is harmless)
    32. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/System.Xml.dll (this message is harmless)
    33. Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/Boo.Lang.dll (this message is harmless)
    34. ----- Total AssetImport time: 0.017325s, Asset Import only: 0.000000s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 7020109312.000000s [524288.00 GB, 0.076476 mb/s], CacheServer Hashing: 7882828288.000000s [Unknown, 1499.833618 mb/s]
    35. Mono: successfully reloaded assembly
    36. - Completed reload, in  1.849 seconds
    37.  
    38. Unloading 5 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    39.  
    40. Unloading 403 unused Assets to reduce memory usage. Loaded Objects now: 4700. Operation took 95.261650 ms.
    41. System memory in use: 175.1 MB.
    42. Begin MonoManager ReloadAssembly
    43.  
    44.  

    At this point it just sits there, locked up.. not responding. At one point today I've let it sit there for almost an hour.. and it still did not finish reloading the Mono assembly... let alone show any output that it had even started reloading it. This one has me baffled because it seems to load everything fine when you first open the project up. You can even hit play and play the game for as long as you want. But the second time that you hit play, or if you make a change to any of the code it will hit this problem and freeze up.

    Thank you so much in advance, all insight is greatly appreciated.


    EDIT: I've also uploaded a crash report from OSX (.hang) that was generated earlier today from this same issue. You can take a look at it here: http://sentrestage.com/files/Unity_2013-08-12-112529_Keiths-MacBook-Pro.hang.
     
    Last edited: Aug 12, 2013
  2. Zoodinger

    Zoodinger

    Joined:
    Jul 1, 2013
    Posts:
    43
    This is a long shot, but still a possibility. Are you using any constructors in your monobehaviour scripts? As far as I know the editor recreates objects all the time, so if you have constructor intensive logic it might lead to bugs. The fact it works the first time made me think about that.
     
  3. SentreStage

    SentreStage

    Joined:
    Aug 8, 2011
    Posts:
    25
    Thanks for the tip, I'll take a look at some of the scripts and see if that could be whats causing this. Though I'm not sure why it would start crashing now. All of the constructors have been the same for a few months now and I just started seeing this crash a couple days ago :\
     
  4. SentreStage

    SentreStage

    Joined:
    Aug 8, 2011
    Posts:
    25
    SOLVED: Turns out that if you do StartCoroutine in the awake method of a script, and use the coroutine to call a server that no longer exists.. and will not give a 403 or any other kind of error (using WWW(url)) meaning it would never give any kind of response then it will allow you to play the game the first time you hit play. However, it looks like after you leave play mode... the Coroutine is still running... and waiting for a response from the non-existent server you tried to call... causing it to get stuck in a neverending loop the second time you hit play. This was happening to me in Unity 3.5.7f6 ... seems like Unity would automatically STOP all coroutines when you leave play mode... but I guess not. (or possibly this causes a port to get stuck open?)
     
    Harinezumi likes this.
  5. moproductions

    moproductions

    Joined:
    Sep 28, 2010
    Posts:
    72
    Hello. I'm actually having the same problem. When I start up unity things are fine, but when I try to make any changes to the code everything hangs. I've checked through all my code and unfortunately there's no StartCoroutine in any of my awake functions let alone server calls. Could this be caused by something else?
    Thanks
    -Mo
     
  6. x70x

    x70x

    Joined:
    Aug 20, 2011
    Posts:
    49
    I just experienced a similar issue when trying to implement the Steam API. I don't have a StartCoroutine call anywhere in my achievements and stats handler, but it does try to make call to Steam's servers to retrieve the game data. It reports that the call is successful, but something is causing it to crash the editor only on the second time attempting to run in play mode. If I take out that one script then it's fine. I'm trying to just adapt the script from the example Steam game Space War so I'm not really sure where to look for a fix.