I've been using Linux (Ubuntu 16.04 and 17.04) for a few months now as my primary OS at home and at work, and for the most part I've been happily breaking and fixing things without much trouble. However, one bug leaves me rather perplexed and I can't seem to find any good information on it:
I've installed both Ubuntu 16.04 and 17.04 with the Unity Desktop environment. And Unity is fairly stable. However, I've also installed gnome, xfce and budgie (via apt-get) to try out some other desktop environments since Unity will be discontinued. And, I get one weird bug with all of them excluding Unity: after my system has been running a while -- usually near the end of the work day, my CPU usage will sometimes randomly spiral out of control on one of my CPU's: I observed this happening only once, as I had gnome-system-monitor already open at the time, and CPU2 (of four) was shown running at 100%, while the others were normal. Memory usage was normal. Everything but the mouse freezes completely, and I can't click on anything or type anything.
I usually do a hard reboot, but I learned that I can drop into a console using ctrl-alt-f1, which I'll try and see what htop has to say about what's going on the next time this happens. Unfortunately, I can't seem to figure out how to replicate this bug, so I just have to wait for it to happen randomly.
As such, I'd really like some advice on how to go about troubleshooting all of the possibilities next time it happens. I feel like there is probably just some process which is not playing nice with any desktop environment other than unity, and that I've not configured something necessary to use my other desktop environments stably? I'm not running any weird programs or processes; I usually just have VS Code, a few terminals, and browser running. Some-times a Virtual Box, though the problem occurs even when not running the latter.
Any clues as to what might be causing my system to hang like this on DE's other than Unity, or how I can go about troubleshooting the problem?