I had a similiar problem that was annoying me once a day or two. There is a system level problem. It is related either your GPU drivers or some of applications installed via Snapstore.
The First (easier solution): If you use snap-store and using Discord on your system it is likely the problem is related with a bug on AppArmor.
solution is here:
sudo snap connect discord:system-observe
if you want to learn more about the cause then check this:
Issue related AppArmor
or
in GPU case follow the steps below:
check the latest updates if it started after an update:
cat /var/log/apt/history.log
in my case these are the changed
libgl1-mesa-dri
libglx-mesa0
libegl-mesa0
libglapi-mesa
libgbm1
libxatracker2
mesa-vdpau-drivers
all graphic related updates. (I use Nvdia drivers too)
I've checked the available packages in my computer.
apt-cache madison libgl1-mesa-dri libglx-mesa0 libegl-mesa0 libglapi-mesa libgbm1 libxatracker2 mesa-vdpau-drivers
then downgrade them 24.0.5-1ubuntu1
sudo apt-get install libgl1-mesa-dri=24.0.5-1ubuntu1 libglx-mesa0=24.0.5-1ubuntu1 libegl-mesa0=24.0.5-1ubuntu1 libglapi-mesa=24.0.5-1ubuntu1 libgbm1=24.0.5-1ubuntu1 libxatracker2=24.0.5-1ubuntu1 mesa-vdpau-drivers=24.0.5-1ubuntu1
if you like you can prevent them to upgrade onwards:
`sudo apt-mark hold libgl1-mesa-dri libglx-mesa0 libegl-mesa0 libglapi-mesa libgbm1 libxatracker2 mesa-vdpau-drivers`