Okay, the one thing I really don't like about #Linux so far is that it absolutely refuses to save me from my own stupidity.
Write an infinite loop or stack overflow into your program by accident?
On Windows, the program hangs. You kill it with the task manager and fix the problem.
On Linux, you apparently have a very short window before the problem spreads and locks up the entire OS, requiring a reboot.
In general, the ability for individual apps to degrade the performance of the entire rest of the system unchecked is a real downer.
@theslik The problem is that the OS stopped responding. I could move the mouse, but nothing else reacted. No programs, not the function key to open the app menu, nothing.
My first thought was to kill the process, but I couldn't find a way to do so.
@LouisIngenthron
If your mouse and desktop stop responding, your display server or compositor may be overloaded. The application may be spaming your display server with request in a loop.
The kernel (linux) is probably still ok, you should open a new tty (CTRL+alt+F3), login and run htop or top to find out what process use too much CPU.
@theslik Ah, thanks. My instinct was to go for another window to kill the process.
I haven't used that ctrl+alt+F3 shortcut in years; I forgot about it.
I'll try that next time!
@theslik Hmmm... it just happened again.
Weirdly, the mouse kept moving fine, so the screen *was* refreshing okay. But nothing responded. No clicks, no keypresses, no ctrl-alt-f3s. The only thing it responded to was me holding the power button for 10 seconds.
In this case, it was caused by trying to launch the Unity Editor on an empty project.
@LouisIngenthron That is very likely just the window manager hanging. The OS is probably fine. As mentioned in another reply, ctr-alt-f# can get you to a terminal.
Crtl-alt-backspace, maybe twice, can restart the display manager and get you back to a fresh start with the UI.
It may be good to setup SSH server on the machine so you could remotely login.
Good luck!
@LouisIngenthron this is due to linuxbbeing highly performant in creating threads. you can use ulimits or cgroups eg through systemd-run to mitigate this
@LouisIngenthron
On linux a stack overflow crash the program (probably a segfault).
An infinite loop hang at 100% cpu on one core as expected. You can allways kill the process. You can't tell the difference between a long running ressources heavy process from a infinite loop. You dont want the kernel to kill your program.