Editor becomes unstable after infinite loop crash

Hi, if you lock up the editor with an infinite loop (while etc), restarting the editor, theres a problem with playback where the editor injects 60~80 millisecond pauses when using while loops.

The only fix is to reboot the computer entirely.

MAC OSX Big Sur
Unity 2019 LTS

Anyone else noticed this?

What do you mean by the editor “injecting” pauses?

Have you used the profiler to see what is going on?

1 Like

Sure yes, this how I was able to see the length of the pauses. They are compacted into a long block called “player loop”. This only happens after reopening Unity after a crash, if I reboot my pc the long pauses are gone.

Switch to deep profiling and drill deeper.

Are you sure it is the while loop itself that is causing pauses? I doubt it. This is a pretty basic C#/Mono construct, not exactly a Unity thing. Try surrounding your suspicious while loop with ProfileMarkers to see if the pause is really happening there. Unity - Scripting API: ProfilerMarker

1 Like

Thanks I’ll try deep profiling. Looking for a way to submit a cohesive bug report, however it’s 2019 LTS and not sure if editor issues will be fixed anyway… Would be interesting to see if this is happening in 2020 LTS