Search Unity

Bug 2022.2.8f1 editor crashes silently on Windows, but works on Mac

Discussion in 'Editor & General Support' started by IgorBoyko, Mar 1, 2023.

  1. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Hello everyone. A little backstory: we are currently trying to upgrade to Unity 2022.2 to take advantage of new features like BRG, so we started upgrading our project from 2021.3.18f1 to 2022.2.8f1. Everything went smoothly, at least I thought it did.

    As I started developing on my Mac, everything was completely fine. Until I booted up another workstation running Windows 11 and tried opening the exact same project from my version control with exactly the same Unity Editor version.

    To my surprise, the Editor just started closing as soon as it went off to load initial domain. No crash report window, nothing. Opening Editor.log brought something interesting up:

    Code (CSharp):
    1. // Script compilations and usual warnings
    2. *** Tundra build success (0.99 seconds), 1 items updated, 1541 evaluated
    3. AssetDatabase: script compilation time: 1.481615s
    4. Begin MonoManager ReloadAssembly
    5. Total cache size 268118488
    6. Total cache size after purge 268118488
    7. StackOverflowException: The requested operation caused a stack overflow.
    8. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    9. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    10. UnityEngine.Logger:LogException(Exception, Object)
    11. UnityEngine.Debug:LogException(Exception)
    12. UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)
    Yes, the editor just crashes with StackOverflowException silently. No information provided to the user though. There is also no crashdump to observe.

    What I noticed is that the editor DOES start up and work if I add an artificial compilation error to my code. Then the editor starts up as normal if I click "Ignore" during the safe mode recommendation window. But as soon as I fix that artificial compilation error, the editor crashes again.

    What I have also tried (each test included removal of Library and Temp folders every time for clean results):
    * Switching to any 3 platforms (Standalone / Android / iOS)
    * Removing all external plugins like External Dependency Manager and Facebook SDK and others
    * Removing all parts of code that may be executed during editor mode
    * Downgrading editor to 2022.2.7f1 and 2022.2.5f1
    * Took the entire manifest.json and moved it to an empty project, to maybe find the error in an installed package. No luck of reproduction.
    * Removing Jobs & Collections packages from the project

    What I also observed:
    * Any other Mac machine works fine
    * Any other Windows machine just crashes with the same error message (tested on 3 different machines)
    * I cannot seem to reproduce this in a clean project

    Is there any possible solution to this, or an option to dig deeper?
     
    Last edited: Mar 1, 2023
    danielliu2012 likes this.
  2. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,361
    It also happens in Windows 10 ?
     
  3. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Not sure as of now as I don't own a Windows 10 machine nearby. Is there any potential thing you're thinking about worth trying a VM out?

    Update: found a Windows 10 machine and tested it out. Same thing.
     
    Last edited: Mar 1, 2023
    nasos_333 likes this.
  4. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    I can confirm that 2022.1.24f1 is not affected by such issue. Will test 2022.2.1f1 and further versions soon (reimporting takes a lot of time in a huge project as ours)
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Is there any chance you have the Input System Package version 1.5.0 installed?
     
  6. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    We are running legacy input system so there's no input system package in the project at all.
     
  7. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    I have tested 2022.2.1f1 and can confidently confirm that it is affected by the issue. So the regression is in-between 2022.1.24f1 and 2022.2.1f1

    Edit: I have also tried removing like 99% of the self-made code which is around 20k files in the project. The issue is gone afterwards. It seems like there is some sort of an issue of parsing the assembly contents, could it be so?
     
    Last edited: Mar 2, 2023
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    IgorBoyko likes this.
  9. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    It seems like the editor does not "crash" in a native way to collect such dumps (tested same settings with custom-built application and dumps are collected properly). As if the editor just closes itself on such exception. Anything I can do to provide more detailed information?
     
    Last edited: Mar 2, 2023
  10. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    I have tested 2 more options:
    * I moved all the project to a folder in the root of the disk, and shortened some folders hierarchy to shorten the overall file paths to accommodate for NTFS path limit (260 symbols)
    * I enabled NTFS long paths support via group policy and registry

    No luck in both cases.
     
  11. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    I can confirm that 2022.2.9f1 fixes the issue at least on my Windows workstation. Will check on other machines asap.
     
  12. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Tested on another machine. 2022.2.9f1 fixes the issue. Another issue noticed is that first full import of the project results into frozen white editor window at the end of asset import. Killing it manually via task manager and restarting fixes the issue.
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Okay I'm glad 2022.2.9f1 fixes it. Unfortunately I have no idea what the issue was :D
     
    IgorBoyko likes this.