Random cc1 processes make my Ubuntu freeze

This is really weird. Sometimes, seemingly without any good reason a bunch of processes named cc1 will pop up and consume all my CPU causing my ubuntu to nearly freeze. After 10-15 seconds those processes disappear again. Does anyone have an idea what's happening?

I googled and it seems that cc1 has to do with the gcc compiler, but I'm not compiling anything. Last time it happened was after a fresh reboot with only Chrome and Terminal running (plus some background processes, such as Dropbox).

Help would be much appreciated!


Solution 1:

This may be due to new kernels being installed on a security update and you have some drivers being built in the background by DKMS. Can you run ps to identify any of the names of the source files being compiled?

Alternatively, install forkstat and run that to see new processes activity:

sudo apt install forkstat
sudo forkstat -d

Solution 2:

Check cc1 arguments (if possible)

ps -eF | grep cc1

You can try do it in loop. Look for something like KBUILD_MODNAME=... or /var/lib/dkms/.... In my case it was incompatible version of DisplayLink USB driver (evdi module) problem. It began using 100% of cpu after installing a new kernel. Everything started working fine after installing new drivers.