Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Frustrated with the worst bug I have ever experienced in Unity

Discussion in '5.4 Beta' started by amit1532, Apr 29, 2016.

  1. amit1532

    amit1532

    Joined:
    Jul 19, 2010
    Posts:
    305
    Hello,
    Unity has a very annoying bug that probably only happens on my machine...
    Every time I change code and go back to the editor there is a high chance of the editor to freeze forever.
    The only thing that I can do is to kill the process...
    It happens when I press play as well. Its so annoying.. I miss the times where I could just run the game, change code, run again without worrying with the task manager open.

    I cant work like that, I end up pressing CTRL + S every time I change something in the scene... Because the editor might freeze soon.
    Sometimes it happens after every compilation, sometimes it takes a few, and sometimes it can be fine for 5 minutes and than freeze.

    I have sent a ticket and the support stopped answering after giving me something to check without any help..
    They could not reproduce the bug.. which is even more frustrating...

    I have Unity pro and i'm actually starting to feel sorry for that.

    bug ticket number:
    791491

    Please help me with this.
     
  2. amit1532

    amit1532

    Joined:
    Jul 19, 2010
    Posts:
    305
    3rd page. How great.. This is why I was waiting until now to send this report.
     
  3. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Hey, I've encountered some interesting project-breaking bugs before, and they are tough to reproduce. Here are some steps I recommend.
    • Delete the Library and Temp folders, and then open your project and let them rebuild
    • Duplicate your project. Delete any script you think could cause the problem (or just all of them) and see if a new script compiles. If it does, restore the scripts and keep removing them until you find the culprit.
    • Delete all scenes and try to compile (I had an error where a single scene was causing problems).
    Basically my advice is to duplicate the project and then...delete delete delete! Eventually it will be a 100% clean project, which obviously should not crash (I'm assuming if you make a new project it's fine).
     
  4. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Which OS BTW? If it's the linux editor, I've occasionally gotten odd window freezes, of which I fixed by moving the window around, then re-maximising it. (This bug only happens on GNOME systems though, and it's probably my outdated graphics chipset that's the culprit)
     
  5. Alex-Lian

    Alex-Lian

    Guest

    I glanced at the bug and it seems QA hasn't been able to repro. Could you perhaps attach a hang dump of the process? Windows let's you do that via the Task Manager or grab a more advanced tool like Process Explorer (also via Microsoft).
     
  6. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Hang on... I did get a window freeze once, and it was straight after I modified a script... Hmm...
    If I run into it again, I'll try offering more info, since I dismissed last time as one of my laptop's typical one-off moments...
     
  7. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
  8. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    Same thing is happening for me, on Windows 10, using latest patch release, on Android project. Seems to be ALWAYS happening when I press Play, then go back and modify a script in Visual Studio, save and then Editor freezes forever. I started removing some old scripts from my project, thinking it would help, but so far no luck. I'll try to repro on a clean project for Android.
     
  9. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Do you have antivirus enabled? Maybe it's locking some files?
     
  10. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    I have reimported project, disabled antivirus (Bitdefender), and it's still happening. Just when it's about finish compiling, it just freezes. Mono.exe is not running. And of course I'm unable to reproduce it on a new project, it's only happening on the most important one :(
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Can you capture a crash dump? You can do it by right clicking on Unity.exe in task manager and pressing "Create dump file":

    upload_2016-5-4_22-42-24.png
     
  12. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    I FIXED IT!
    Jesus, what a nasty thing that was. The cause was the Photon Cloud plugin, specifically the Chat. Not Unity's fault. It seems you have to call Disconnect() on you Photon Chat behavior before you quit the game in the Editor, I've only begun to implement the Photon chat, just a barebones implementation attached to a gameobject, and it just left the connection open without cleaning itself up, and then on script recompile, it would freeze main thread for some reason. Seems someone at Photon forums had a similar issue few months ago: http://forum.photonengine.com/discussion/6082/leaked-connection-causes-unity-to-freeze

    It seem to be happening only in the scene where I had the Chat thing object attached, so that's how I was able to pinpoint the issue. Removing scripts one by one, pressing Play, modifying script and saving, then trying to compile.
     
  13. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    I don't know anything about Photon but it's possible it has another thread running that is blocking Unity from proceeding. I'm working on a tool that uses networking and threads, and while I have my tool open with these threads running, if I trigger a recompile/reload assemblies or try to quit Unity, Unity just blocks until I kill the network connection (which causes the threads to finish). I think I dug into the Mono source code a while ago and found that it *should* be aborting any running .NET threads (but I wasn't looking through the Unity version Mono I think).
     
    Last edited: May 10, 2016
  14. brockemon

    brockemon

    Joined:
    Dec 21, 2012
    Posts:
    48
    Hi,

    I am having all of these exact same issues for a long time. Have filled a bug report. I am not using Photon. So am guessing it is some other library.

    I have Google Analytics, Google Play Games and Unity Ads.

    Will be watching this thread for solutions!!
     
  15. brockemon

    brockemon

    Joined:
    Dec 21, 2012
    Posts:
    48