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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

[2017.2f1] Editor randomly freezes when pressing play

Discussion in '2017.2 Beta' started by Muuuuo, Sep 25, 2017.

  1. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    I'm making this thread to bring visibility to this bug and possibly to find other people with the same issue.

    I tried updating my 2017.1.1 project to 2017.2f1 and while the update itself went smoothly, I've encountered a fatal editor bug that is preventing me from upgrading.

    Basically after opening my project in 2017.2 and pressing play the editor might freeze and lock up, requiring me to close the editor from task manager. This happens before any of the scene scripts are being run so it can't be an infinite loop or other script error. The editor does not go to the "Not Responding" state; it just doesn't accept any user interaction.

    The weird part is some completely arbitrary actions in the editor before pressing play may fix the problem so the editor doesn't lock up and starts normally when pressing play. Some of the actions I've found to do this are:

    - Simply clicking on some objects in scene hierarchy before pressing play
    - Changing random settings from project settings, specifically changing asset serialization to "force text" (however the issue is back on the next editor launch even with the changed settings)

    The issue might also come back after few minutes so doing these "fixes" once isn't a solution. I have not been able to reproduce this in a dummy scene so I can't file a bug report. The issue does not happen in an empty scene, but I have not been able to isolate any certain object causing this behavior either. I'm also not comfortable sending my 20gb project to Unity so I'm kinda out of options.

    So few questions:
    - Anyone else noticed this? Maybe even a known issue?
    - Are there any ways for me to debug this? Like I said I can't isolate the issue to a certain script or object, and the issue happens before any of the scene scripts are even ran.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,591
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,064
    Hi Kuura,
    Could you please file a bug report with a minimal reproduction case for this issue and reply in here with the case #?
     
  4. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    I love the work you do but man you really have to read the posts before posting that boilerplate... Here I'll quote the relevant parts for you.

    Anyway, ignoring that intermission..

    I looked at the editor logs and it freezes after the lines

    Registered platform support modules in: 0.0311762s.
    Native extension for WindowsStandalone target not found
    Load scene 'Temp/__Backupscenes/0.backup' time: 1.112840 ms
    Load scene 'Temp/__Backupscenes/1.backup' time: 1.070758 ms

    Here's a logfile for a launch that freezes unity https://pastebin.com/Vv7QLRMQ
    Here's a logfile for a launch that works normally https://pastebin.com/JS81Ugqf

    In the first case the editor was opened and I pressed play.

    In the second case the editor was opened, I selected several gameobjects by clicking them in the hierarchy and then pressed play. The objects I selected in the hierarchy do not have any custom code or custom inspectors and I literally did nothing but select them.

    I have confirmed that no scene scripts ever get run by trying to print a value in the Awake method of a script with the earliest execution order set. The editor logfile does not contain the printed value when it freezes.
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,591
    yeah..doesnt say much.

    some things that be tested
    - rebuild lighting, if just upgraded new version
    - delete editor plugins, if got any
    - switch between monodev / visual studio as external editor
    - make build, does it crash there with any extra info?
    - do full re-importort all
     
  6. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    I don't use reflection probes or GI but i'll try this and report results later.
    Edit: No difference.
    I tried deleting all 3rd party editor extensions but the issue persists.
    I'll give this a try and report results later.
    Edit: No difference.
    I'll give this a try and report results later.
    Edit: Builds work normally.
    Deleting library and re-importing everything did not help.
     
    Last edited: Sep 26, 2017
  7. OtakuD

    OtakuD

    Joined:
    Apr 24, 2014
    Posts:
    48
    Do you use Tiled2Unity? All my scenes that use maps from that seem to not load.
     
  8. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    No I don't. It's nice to notice I'm potentially not alone with the issue though.

    Are you having similar issues as me or do the scenes not load at all in the editor when you try to open them?
     
  9. OtakuD

    OtakuD

    Joined:
    Apr 24, 2014
    Posts:
    48
    It's very similar though when I remove certain game objects (mainly tiled2unity maps for me) the editor seems to run fine. The rest of the time it's almost like it hit an infinite loop and I have to force close the program.
     
  10. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,346
    My project's also freezing when I press Play. Worked fine in 2017.1. Also haven't figured out what's causing it yet in order to submit a repro.
     
  11. Barkers-Crest

    Barkers-Crest

    Joined:
    Jun 19, 2013
    Posts:
    158
    I am getting freezes all the time now as well. Didn't happen until the first release candidate and perhaps b11 as well. I'm getting it on multiple machines.

    My partner is getting freezes all the time, too. We both have to kill Unity with Task manager.

    Not the kind of things you can really submit a bug for.
     
  12. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,346
    I just reverted to 2017.1 after spending a few hours trying to nail down what was causing all the crashes and freezes. Sorry, I just can't today, Unity. ;)
     
  13. CarlosRincon

    CarlosRincon

    Unity Technologies

    Joined:
    Jan 28, 2016
    Posts:
    125
    OtakuD, makeshiftwings, Barkers-Crest (and anyone else experiencing this), are you guys also running editor on Windows? Could you please specify OS version if possible?

    Also, do you guys have the problem specifically after upgrading a project from 2017.1 (as seems to be the case for Kuura)? Or does it seem more widespread than that?

    Or if anyone is able to provide a repro project, it would be appreciated. So far we have not been able to reproduce.
     
    Last edited: Sep 27, 2017
  14. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    OS is Windows 10. Project was upgraded from 2017.1.1f1 to 2017.2f1, but full Library folder deletion didn't help either.

    The issue gets fixed if the project is downgraded back to 2017.1.1f1.

    I spent at least an hour trying to isolate the problem to a smaller project or to a certain object/script but to no avail.
     
  15. Alex-Lian

    Alex-Lian

    Guest

    Could someone provide a hang dump from Windows when it's in the stuck state?
     
  16. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    You have private messages off but I gave a link to a hang dump to CarlosRincon.
     
  17. Alex-Lian

    Alex-Lian

    Guest

    Alright, got the dump over to some engineers and a clear race condition for us to fix.

    Working on it pronto. Thank you for the assist.

    In the future in such cases, still create a bug report and attach the hang dump there, and post the bug # here. We can still process it with just that assuming you give us the dump to help try and analyze it without repro steps.
     
    Muuuuo likes this.
  18. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,346
    In my case I'm on Windows 10, the editor is in .NET 4.6 mode, and it was a project updated from 2017.1 to 2017.2. I didn't get a crash dump; when it hung I had to kill it in Task Manager, and for some reason the bug reporter didn't pop up, so no crash dump was created. As I mentioned, I reverted to 2017.1 because I need to get work done today but I'll try 2017.2 again soon.
     
  19. Alex-Lian

    Alex-Lian

    Guest

    When it's hung, Task Manager has an option to create a dump. Do that, and manually attach.
     
  20. Barkers-Crest

    Barkers-Crest

    Joined:
    Jun 19, 2013
    Posts:
    158
    It happens on Windows 10 build 15063.540 and also Windows Insider fast ring.

    The project has been through a couple different Unity Version changes. 2017.1 to 2017.2 has happened.

    Next time it freezes I'll attempt to get the dump through task manager.
     
  21. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    371
    I have a similar (maybe the same?) issue on Mac, but it already started with 2017.1. In 2017.2 it happens too, although it was an older beta when I last checked. My project is also in .NET 4.6 mode. I don't remember it happening for another project which is still in the old .NET mode.

    Starting or stopping the game in the editor sometimes freezes, sometimes crashes Unity. It happens 3-4 times a day and it's pretty annoying because it's not very predictable. I also can't reproduce it, but I have some crash logs. In the crash case, I recall seeing the crashed thread doing something with GC or loading a backup scene. Next time it freezes, I'll try to get some info about it.

    Here are two different crashed threads, one when starting play mode (I think), the second while stopping play mode. Both are from 2017.1.1p2. In case it's clearly not the same issue, I'm happy to create a new thread about it.

    Code (CSharp):
    1. Exception Type:        EXC_BAD_ACCESS (SIGABRT)
    2. Exception Codes:       EXC_I386_GPFLT
    3. Exception Note:        EXC_CORPSE_NOTIFY
    4.  
    5. Application Specific Information:
    6. abort() called
    7.  
    8. Thread 0 Crashed:: tid_307  Dispatch queue: com.apple.main-thread
    9. 0   libsystem_kernel.dylib            0x00007fffa91a7d42 __pthread_kill + 10
    10. 1   libsystem_pthread.dylib           0x00007fffa9295457 pthread_kill + 90
    11. 2   libsystem_c.dylib                 0x00007fffa910d420 abort + 129
    12. 3   com.unity3d.UnityEditor5.x        0x00000001016ad031 HandleSignal(int, __siginfo*, void*) + 81
    13. 4   libmonobdwgc-2.0.dylib            0x000000013b9e0b9e mono_chain_signal + 79
    14. 5   libmonobdwgc-2.0.dylib            0x000000013b8e3cef mono_sigsegv_signal_handler + 419
    15. 6   libsystem_platform.dylib          0x00007fffa9288b3a _sigtramp + 26
    16. 7   ???                               000000000000000000 0 + 0
    17. 8   libsystem_c.dylib                 0x00007fffa90f59fc __vfprintf + 5701
    18. 9   libsystem_c.dylib                 0x00007fffa911e423 __v2printf + 699
    19. 10  libsystem_c.dylib                 0x00007fffa90f3f46 _vasprintf + 554
    20. 11  libmonobdwgc-2.0.dylib            0x000000013bae48c7 monoeg_g_strdup_printf + 161
    21. 12  libmonobdwgc-2.0.dylib            0x000000013bad11f4 mono_error_get_message + 193
    22. 13  libmonobdwgc-2.0.dylib            0x000000013b9efdb2 mono_class_setup_vtable_general + 603
    23. 14  libmonobdwgc-2.0.dylib            0x000000013b9efa8b mono_class_setup_vtable_full + 426
    24. 15  libmonobdwgc-2.0.dylib            0x000000013b9edc61 mono_class_get_vtable_entry + 201
    25. 16  libmonobdwgc-2.0.dylib            0x000000013b9897c0 mono_vcall_trampoline + 183
    26. 17  ???                               0x00000001297e469e 0 + 4991108766
    27. 18  ???                               0x0000000183df1a35 0 + 6507403829
    28. 19  libmonobdwgc-2.0.dylib            0x000000013b8e6d81 mono_jit_runtime_invoke + 2389
    29. 20  libmonobdwgc-2.0.dylib            0x000000013ba93065 do_runtime_invoke + 88
    30. 21  libmonobdwgc-2.0.dylib            0x000000013ba92fbb mono_runtime_invoke + 31
    31. 22  com.unity3d.UnityEditor5.x        0x00000001019d2add ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 125
    32. 23  com.unity3d.UnityEditor5.x        0x00000001019d29db ScriptingInvocation::InvokeChecked(ScriptingExceptionPtr*) + 59
    33. 24  com.unity3d.UnityEditor5.x        0x00000001016999d1 MonoBehaviour::CallMethodInactive(ScriptingMethodPtr) + 353
    34. 25  com.unity3d.UnityEditor5.x        0x000000010169d981 MonoBehaviour::CallAwake() + 113
    35. 26  com.unity3d.UnityEditor5.x        0x000000010169df80 MonoBehaviour::AddToManager() + 288
    36. 27  com.unity3d.UnityEditor5.x        0x00000001019dff58 AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode) + 120
    37. 28  com.unity3d.UnityEditor5.x        0x00000001019dfd36 AwakeFromLoadQueue::AwakeFromLoad(AwakeFromLoadMode, bool) + 422
    38. 29  com.unity3d.UnityEditor5.x        0x00000001012d72ae AwakeAndActivateClonedObjects(Object**, vector_map<int, int, std::less<int>, stl_allocator<std::pair<int, int>, (MemLabelIdentifier)1, 16> > const&) + 382
    39. 30  com.unity3d.UnityEditor5.x        0x00000001012d751a CloneObject(Object&) + 234
    40. 31  com.unity3d.UnityEditor5.x        0x0000000101f31cb5 Object_CUSTOM_Internal_CloneSingle(MonoObject*) + 181
    41. 32  ???    
    Code (CSharp):
    1. Crashed Thread:        0  tid_307  Dispatch queue: com.apple.main-thread
    2.  
    3. Exception Type:        EXC_BAD_ACCESS (SIGABRT)
    4. Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
    5. Exception Note:        EXC_CORPSE_NOTIFY
    6.  
    7. VM Regions Near 0:
    8. -->
    9.     __TEXT                 0000000100000000-000000010474c000 [ 71.3M] r-x/rwx SM=COW  /Applications/Unity 2017.1.1p2/Unity.app/Contents/MacOS/Unity
    10.  
    11. Application Specific Information:
    12. abort() called
    13.  
    14. Thread 0 Crashed:: tid_307  Dispatch queue: com.apple.main-thread
    15. 0   libsystem_kernel.dylib            0x00007fffe0681d42 __pthread_kill + 10
    16. 1   libsystem_pthread.dylib           0x00007fffe076f457 pthread_kill + 90
    17. 2   libsystem_c.dylib                 0x00007fffe05e7420 abort + 129
    18. 3   libmonobdwgc-2.0.dylib            0x000000013c133597 mono_handle_native_sigsegv + 566
    19. 4   libsystem_platform.dylib          0x00007fffe0762b3a _sigtramp + 26
    20. 5   ???                               0x0000000143dd3400 0 + 5433537536
    21. 6   libsystem_c.dylib                 0x00007fffe05e7420 abort + 129
    22. 7   libmonobdwgc-2.0.dylib            0x000000013c2a003c GC_stop_world + 140
    23. 8   libmonobdwgc-2.0.dylib            0x000000013c29f755 GC_stopped_mark + 62
    24. 9   libmonobdwgc-2.0.dylib            0x000000013c29f4b1 GC_try_to_collect_inner + 311
    25. 10  libmonobdwgc-2.0.dylib            0x000000013c2a0be7 GC_try_to_collect_general + 158
    26. 11  libmonobdwgc-2.0.dylib            0x000000013c2a0c5c GC_gcollect + 13
    27. 12  com.unity3d.UnityEditor5.x        0x000000010167c54b CleanupAfterLoad() + 155
    28. 13  com.unity3d.UnityEditor5.x        0x0000000101979218 LoadSceneOperation::IntegrateMainThread() + 456
    29. 14  com.unity3d.UnityEditor5.x        0x000000010197b0b7 PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int) + 471
    30. 15  com.unity3d.UnityEditor5.x        0x000000010197ba42 PreloadManager::WaitForAllAsyncOperationsToComplete() + 114
    31. 16  com.unity3d.UnityEditor5.x        0x0000000100a55e77 EditorSceneManager::RestoreSceneBackups(std::vector<EditorSceneManager::SceneBackup, stl_allocator<EditorSceneManager::SceneBackup, (MemLabelIdentifier)101, 16> >&, EditorSceneManager::PlayModeChange, bool) + 1815
    32. 17  com.unity3d.UnityEditor5.x        0x000000010036b8ca Application::ExitPlayMode() + 106
    33. 18  com.unity3d.UnityEditor5.x        0x0000000100366f4f Application::SetIsPlaying(bool) + 207
    34. 19  com.unity3d.UnityEditor5.x        0x000000010036671c Application::TickTimer() + 4268
    35. 20  com.apple.Foundation              0x00007fffcc85ee0f __NSFireTimer + 83
    36. 21  com.apple.CoreFoundation          0x00007fffcadd4c54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    37. 22  com.apple.CoreFoundation          0x00007fffcadd48df __CFRunLoopDoTimer + 1071
    38. 23  com.apple.CoreFoundation          0x00007fffcadd443a __CFRunLoopDoTimers + 298
    39. 24  com.apple.CoreFoundation          0x00007fffcadcbb81 __CFRunLoopRun + 2065
    40. 25  com.apple.CoreFoundation          0x00007fffcadcb114 CFRunLoopRunSpecific + 420
    41. 26  com.apple.HIToolbox               0x00007fffca32bebc RunCurrentEventLoopInMode + 240
    42. 27  com.apple.HIToolbox               0x00007fffca32bbf9 ReceiveNextEventCommon + 184
    43. 28  com.apple.HIToolbox               0x00007fffca32bb26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
    44. 29  com.apple.AppKit                  0x00007fffc88c4a54 _DPSNextEvent + 1120
    45. 30  com.apple.AppKit                  0x00007fffc90407ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
    46. 31  com.apple.AppKit                  0x00007fffc88b93db -[NSApplication run] + 926
    47. 32  com.apple.AppKit                  0x00007fffc8883e0e NSApplicationMain + 1237
    48. 33  com.unity3d.UnityEditor5.x        0x000000010220cc85 EditorMain(int, char const**) + 853
    49. 34  com.unity3d.UnityEditor5.x        0x000000010220d0f9 main + 9
    50. 35  libdyld.dylib                     0x00007fffe0553235 start + 1
     
    Last edited: Sep 28, 2017
  22. CarlosRincon

    CarlosRincon

    Unity Technologies

    Joined:
    Jan 28, 2016
    Posts:
    125
    Hi guys, although we have a good idea of where the race condition is happening, we still haven't managed to reproduce the hangs ourselves, so verifying any fix is going to be tricky.

    So, repeating the request from yesterday in case there are any takers: is anyone able to provide a project where the issue is exhibiting?

    And one further question: did the folks experiencing the freeze not see such problems with earlier 17.2 betas? Or is it simply that you hadn't tried upgrading your projects with those earlier betas?
     
  23. Barkers-Crest

    Barkers-Crest

    Joined:
    Jun 19, 2013
    Posts:
    158
    @CarlosRincon This was not happening on earlier betas.

    I'll be more than happy to upload my project if you give me a private place to drop it.

    Edit: It has happened to me about 3 or 4 times in the past hour.
     
  24. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    I never tried earlier betas myself. I'll try downgrading my project to b11 later today.
     
  25. CarlosRincon

    CarlosRincon

    Unity Technologies

    Joined:
    Jan 28, 2016
    Posts:
    125
    Barkers-Crest, you can use the bug reporter, which can handle up to 2gb (zipped up size of the project folder). You can reduce the size if you include only Assets and ProjectSettings folders (so no library folder or builds you might have created). If you go this route, please ping over the case number so we can pick it up.

    Alternatively you can drop it into the location I've sent you by private conversation.

    Many thanks in advance BTW!
     
  26. Barkers-Crest

    Barkers-Crest

    Joined:
    Jun 19, 2013
    Posts:
    158
    Uploaded, thanks.
     
  27. Muuuuo

    Muuuuo

    Joined:
    Apr 16, 2015
    Posts:
    57
    Tested my project and the freeze does not happen in 2017.2b11.
     
  28. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    371
    Reported a freeze case (without project, but with process sample): 955714
     
  29. CarlosRincon

    CarlosRincon

    Unity Technologies

    Joined:
    Jan 28, 2016
    Posts:
    125
    Thanks all, we have identified the change that introduced the issue and it did indeed land for f1. A fix is on the way, but please note that f2 (just released) still has the issue.
     
  30. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,753
    Will the fix included in the next release?
     
  31. CarlosRincon

    CarlosRincon

    Unity Technologies

    Joined:
    Jan 28, 2016
    Posts:
    125
    Yes, we have a fix and it will be in the next release.
     
    Reanimate_L likes this.