Hi,
We’d like to share a debugging technique with you that will allow you to capture call stacks of the Editor when it is hung up and unresponsive. Attaching these call stacks to your bug reports can in some instances help us figure out where and why things are getting stuck, even if you can’t share your projects or other details with us.
For some time we’ve been testing out an approach that will help show where the editor gets stuck and is compatible with old and new versions of Unity as well.
What, you’ll need:
- Process Explorer from SysInternals
- The right dbghelp.dll can be installed from here: Debugging Tools for Windows
Then, open up Process Explorer, and in there find Unity.exe with the right parameters (i.e. the one that contains -projectpath [your_project_name])
Inside Process Explorer click on Options → Configure Symbols and point to the right dbghelp.dll from step 2.
The Symbols Path should be the path to the Editor folder for the version of Unity you want to debug (i.e. C:\Program Files\Unity\Hub\Editor[UNITY_VERSION]\Editor\ ). It’s important to select the right version of the Editor because it will use the symbols supplied by the PDB files to figure out the name of the functions being executed. Unfortunately, it cannot resolve call stack frames that are using Mono in them.
Once that is set up, double click Unity.exe in ProcessExplorer, go to the Threads tab, and double click the one that says Unity.exe!WinMainCRTStartup
That will show the current call stack on the main thread in Unity (like in the picture below). Using this call stack can help us figure out what’s going on with the Editor faster, and it might speed up our debugging investigations as well.
Looking forward to helping out and resolving these issues of the editor getting stuck. Please feel free to use this thread to ask questions and discuss the debugging process. Please don’t use it to report your issues. Use the bug reporter for that.