97

This issue i had it with 15.10 and it's still here after the 16.04 upgrade. The whole system freezes, no keyboard/mouse input works anymore. I tried a variety of keyboard combinations (found on the internet, like Alt+SysRq+REISUB and others), but none actually worked. The system is completely unresponsive, only a force shutdown works at this point. Interestingly, i can't correlate this freeze with any specific program or application, as the system hangs sometimes even while doing the simplest operations like opening the Terminal, or the Unity search.

I would be interested if there is any log saved that could contain useful information on these hangs.

Thank you.

  • 2
    I found this in /var/log/syslog around the moment of freeze (dunni if it's related...):

    Apr 24 15:19:31 bro org.gnome.zeitgeist.Engine[1107]: ** (zeitgeist-datahub:1910): WARNING **: zeitgeist-datahub.vala:212: Error during inserting events: GDBus.Error:org.gnome.zeitgeist.EngineError.InvalidArgument: Incomplete event: interpretation, manifestation and actor are required \00\00\00....\00\00\00\00\00Apr 24 15:21:11 bro rsyslogd: [origin software="rsyslogd" swVersion="8.16.0" x-pid="665" x-info="http://www.rsyslog.com"] start

    –  Apr 24 '16 at 12:28
  • I was experiencing the same problem. Check this: http://askubuntu.com/questions/760731/lenovo-thinkpad-11e-randomly-freezes-on-ubuntu-16-04/766011#766011 – CMorales May 01 '16 at 18:19

6 Answers6

62

I was facing a similar problem on my Ubuntu 16.04. It used to freeze randomly a lot and I had to perform a forced shutdown each time.

Upgrading the kernel to 4.7-rc3 did not work for me!

I found out that there was no swap memory area allocated(sudo swapon --show returned nothing and free -h showed there was 0B space allocated for swap memory) for my Ubuntu OS(I have a dual-boot system: Windows 7 & Ubuntu 16.04). I allocated swap space for Ubuntu and guess what, the problem is gone! Hope this helps. :)

Edit: I was wrong! This problem was not solved and it has nothing to do with swap memory, though allocating swap memory apparently fixed another type of freeze where continuous hard disk access occurs during the freeze and where it is possible to kill the latest process forcefully (by typing alt+sysrq+F from keyboard) to recover from the freeze.

However, this problem(where nothing but forced shutdown works to recover from the freeze) may be related to the kernel and if kernel upgrading cannot solve the problem, then a workaround could be to add the statement intel_idle.max_cstate=1 in the grub configuration file:

STEPS

  1. sudo nano /etc/default/grub
  2. There is a line in that: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" (like this), replace with: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
  3. Save it (CTRL+O)
  4. sudo update-grub
  5. sudo reboot

I will try this if I face the problem again(since in my case this problem is very rare now, occurred only once within a week after swap allocation, which led to the confusion), but there are people who have solved this kind of problem by this workaround.

Late update: Actually, I tried the above-mentioned workaround a couple of weeks after posting the Edit (most probably because the problem reappeared again, but it was not frequent for sure). After modifying the grub file, the problem was resolved completely and I have not come across any type of freezing after that, so this workaround seems to be a good one! :) Sorry for the late update.

  • 10
    It's been half a year, have you frozen again? – Izkata Jan 14 '17 at 01:50
  • 1
    @Izkata: Please see the update. Sorry for any inconvenience caused. – Snehasish Karmakar Jan 19 '17 at 11:42
  • Thanks for this answer: had same problem - Ubuntu 16.04 with kernel 4.4.0 and swap space was freezing randomly on my laptop quite frequently (once per 2 hours). Upgraded kernel to 4.8.0 and still problem persisted, though it seem to happen less frequently.

    Now trying to use intel_idle.max_cstate=1 setting in grub and will report about results

    – Yuriy Nakonechnyy Mar 24 '17 at 11:04
  • 1
    I experienced the freeze again 5min after applying your procedure. I must also mention that when I get the freeze, the fan start to spin very fast continuously. There is maybe somewhere an infinite loop that burden the computer and freeze it... I have 8Gb swap, dual boot ubuntu 16, my kernel is up to date and I must mention that I use Nvidia proprietary driver with CUDA toolkit 8 – Yohan Obadia Apr 05 '17 at 09:17
  • 2
    It's been three days after I applied the grub changes and no freezes so far! – Marco Apr 07 '17 at 14:43
  • This setting may increase battery consumption. – Richard May 17 '17 at 20:05
  • 2
    not working for me :( – YaSh Chaudhary Jul 28 '17 at 20:21
  • I have updated my kernel to 4.9 and have made that change to grub. My ubuntu was freezing multiple times a day before, but so far it has been running well. So I think this may have worked. – Aurelin Aug 26 '17 at 13:23
  • @Richard Can you provide the reason? – satriahrh Jan 09 '18 at 11:29
  • I also had problems with making the computer Suspend - it wouldn’t start back to the same state, and showed error messages as if it was unsafely restarted. Now the Suspend works well. – Oren Jul 11 '18 at 19:32
  • Awesome! The grub edit fixed it for me! I cannot be happier :D – Shadi Apr 17 '19 at 11:32
  • This grub edit works for me too! Best 3 days of my life – choz Dec 05 '19 at 18:27
  • intel_idle.max_cstate=1 seems to increase CPU usage considerably. Anyway, I think I found the corresponding kernel bug report with plenty discussion on it: https://bugzilla.kernel.org/show_bug.cgi?id=109051.

    Looks like the freezing issue is more prevalent in intel baytrail systems.

    – ritiek Apr 28 '20 at 02:31
  • Have you tried upgrading Linux Kernel to 4.7-RC3? – Matej J May 03 '20 at 00:41
  • Can confirm this works, I have used this with Ryzen 5 2500u on Debian, Elementary, Ubuntu and now Pop!OS. Thanks for writing this. – Awakened Apr 21 '21 at 08:56
  • I tried this solution last year, and it did something which stopped this issue. But it's back again now – Bhaskar Jul 19 '21 at 06:26
13

Go to "synaptic-settings-repositories-additional drivers." See if you have a "Unknown Unknown" radio button If you have, then select it as I have in picture. Two weeks I have not had one freeze.

enter image description here

muru
  • 197,895
  • 55
  • 485
  • 740
user3783628
  • 151
  • 1
  • 2
11

Updating the kernel worked for me. I suspect the issue was graphics related because I noticed a warning during the upgrade. I followed the steps at http://sourcedigit.com/19889-how-to-update-install-linux-kernel-4-7-rc3-on-ubuntu-16-04/ to upgrade the kernel then downloaded the missing firmware. Full steps detailed below.

Download the necessary files:

wget kernel.ubuntu.com/~kernel-ppa/mainline/v4.7-rc3-yakkety/linux-headers-4.7.0-040700rc3_4.7.0-040700rc3.201606121131_all.deb 
wget kernel.ubuntu.com/~kernel-ppa/mainline/v4.7-rc3-yakkety/linux-headers-4.7.0-040700rc3-generic_4.7.0-040700rc3.201606121131_i386.deb 
wget kernel.ubuntu.com/~kernel-ppa/mainline/v4.7-rc3-yakkety/linux-image-4.7.0-040700rc3-generic_4.7.0-040700rc3.201606121131_i386.deb

Once the files have downloaded, install them with dpkg:

sudo dpkg -i linux-headers-4.7*.deb linux-image-4.7*.deb

Look out for warnings in the output. I came across the warning: W: Possible missing firmware /lib/firmware/i915/skl_guc_ver6.bin for module i915

Download this missing module and copy it to the stated folder:

wget https://ftp2.halpanet.org/source/_dev/linux-firmware.git/i915/skl_guc_ver6.bin
sudo cp skl_guc_ver6.bin /lib/firmware/i915/

It might not be necessary, but I reinstalled the v4.7 Kernel after copying the module, this time the warning did not come up:

sudo dpkg -i linux-headers-4.7*.deb linux-image-4.7*.deb

Once reinstalled, update GRUB and reboot:

sudo update-grub
sudo reboot

After this my Ubuntu 16.04 install has been running smoothly on the 4.7RC3 kernel.

pnd001
  • 176
2

Re: freezing screen with Ubuntu 16.04

This only started recently with me. After watching in the monitor I noticed the process Web Content was taking almost all the CPU time and a lot of memory until I ran out of my 6 GB.

I solved it by using these following procedures, after removing a Cookie editor extension:

  1. Under Firefox preferences: Accept third-party cookies only from visited websites!

  2. Change this in GRUB (Ubuntu 15.10 and 16.04 keep freezing randomly).

    There is a line in that: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" (like this), replace with: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"

  3. My swap was not being used at all! I doubled my swap space to that of my memory (12 GB) - https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04

  4. It would still freeze or run very slowly. I finally solved with this. I installed noscript (noscript.net/forums) from Firefox/Tools/Extensions and only allowed a select few sites to run JavaScript.

karel
  • 114,770
2

Try updating your kernel, I had installed Ubuntu 16.04 and it had that problem.

I thought it was my laptop and I removed Ubuntu and installed Lubuntu. After a while it freezed too.

I updated my kernel and it solved my issue imediately. Just tell me if you need help updating your kernel.

Videonauth
  • 33,355
  • 17
  • 105
  • 120
  • 4
    You could add what kernel you used to solve your problem and provide the steps you did to upgrade to bolster up your answer. Cheers and welcome on Ask Ubuntu. – Videonauth Apr 30 '16 at 03:38
  • 1
    it really depends on the kernel you already have ,i was running 3.5 and i updated to 4.5.you have to open your terminal and type this command "uname -r".it will show you the kernel you are running .then Go here: http://askubuntu.com/questions/119080/how-to-update-kernel-to-the-latest-mainline-version-without-any-distro-upgrade – Germain Rwibutso May 02 '16 at 06:15
  • I have the same problem. I updated kernels up to the 4.15. It is enough to start docker with a couple of containers to freeze the system. Nor any SysRq sequence can recover the situation. – Antonio Petricca Mar 26 '18 at 09:26
2

My answer is not a permanent fix, but it should resolve the issue when it presents its self. Before I go on let me say that this question has been asked and answered for multiple releases. The answers provided here are things I have myself attempted yet did not prove to be permanent.

After updates etc. these changes were undone and out of annoyance i elected to stop making them. Also some of the answers here and in the various other threads on this topic didn't help me at all.

So if you continu to experience an issue please try

Ctrl + Alt + F1
Ctrl + Alt + F7

This should temporarily resolve the problem. Before people down vote this and I accept that they will. Take into consideration how old this issue is and that it continues to crop up. I say again that I've experienced this for quite a long time and so far this is the only way I've been able to immediately resolve it.

dessert
  • 39,982
Afflicted
  • 800
  • 4
    What you are describing is called console switching. When that works, SysRQ would probably work as well. Your solution works for problems involving Xwindows (for example, when X loses track of DPMS for some reason). In the hangs I have seen, the OS hangs completely, and the computer only responds to functions performed independently of the OS, such as the backlight. Networking for example is also dead in the cases I have seen. Your issue appears to be different than the original poster's issue. – BertD May 26 '17 at 12:00
  • No your interpretation of my issue seems to be different. I don't care what it's supposed to do. I simply stated what it did do for me. – Afflicted May 26 '17 at 12:13