Ubuntu 20.04 freezing and crashing

6,690

Solution 1

As @heynnema suggested, I updated the BIOS. As suggested on numerous other sites, I edited /etc/default/grub and added

intel_idle.max_cstate=1 processor.max_cstate=1

in GRUB_CMDLINE_LINUX=""

Similar crashing happens with NVIDIA hardware; explained here.

Just updating the BIOS didn't stop the crashing, although they were happening less regularly. I DO NOT understand, why changing the grub stopped the crashing.

Solution 2

Lots of crashing. Let's start with these...

BIOS

Acer Spin 3

You have BIOS version 1.04.

There's a newer BIOS available, version 1.08, dated 4/17/2018, and can be downloaded here.

Note: Confirm that I have the correct web site for your model #.

Note: Have good backups before updating the BIOS.

memory

Go to https://www.memtest86.com/ and download/run their free memtest to test your memory. Get at least one complete pass of all the 4/4 tests to confirm good memory. This may take many hours to complete.

Share:
6,690

Related videos on Youtube

Urh
Author by

Urh

Updated on September 18, 2022

Comments

  • Urh
    Urh almost 2 years

    I recently upgraded from version 18 LTS to 20 using Software update, and am noticing random freezing or crashing of the system ever since.

    Symptoms The crash usually starts with some windows freezing completely (no responses) (vs code or firefox), and in a short period (30s-60s) the whole system freezes and the only way to proceed is a reboot via power button. Lately, i also noticed some instant crashes, with the whole screen going black. I also noticed crashing usually occurs when using firefox or vs code (but not when intentionally executing hard calculations).

    /var/crash

    The lastest file is 3 days old, the last crash was today.

    urh@urh-laptop:/var/crash$ ls
    linux-image-5.4.0-54-generic.203356.crash    _opt_teamviewer_tv_bin_teamviewerd.0.uploaded  _usr_share_code_code.1000.crash
    linux-image-5.4.0-54-generic.213157.crash    _usr_bin_gnome-shell.1000.crash                _usr_share_code_code.1000.upload
    _opt_teamviewer_tv_bin_teamviewerd.0.crash   _usr_bin_gnome-shell.1000.upload               _usr_share_code_code.1000.uploaded
    _opt_teamviewer_tv_bin_teamviewerd.0.upload  _usr_bin_gnome-shell.1000.uploaded
    

    Parts from _usr_share_code.1000.crash:

      GNU nano 4.8                                                                          _usr_share_code_code.1000.crash                                                                                    
    ProblemType: Crash
    Architecture: amd64
    Date: Tue Dec  1 14:01:31 2020
    DistroRelease: Ubuntu 20.04
    ExecutablePath: /usr/share/code/code
    ExecutableTimestamp: 1603764692
    ProcCmdline: /usr/share/code/code\ --type=renderer\ --disable-color-correct-rendering\ --no-sandbox\ --field-trial-handle=11739126107242220802,6576820938724679016,131072\ --enable-features=WebComponents>
    ProcCwd: /home/urh
    ProcEnviron:
    ProcMaps:
    .
    .
    .
    ProcStatus:
     Name:  code
     Umask: 0002
     State: S (sleeping)
     Tgid:  288605
     Ngid:  0
     Pid:   288605
     PPid:  288509
     TracerPid:     0
     Uid:   1000    1000    1000    1000
     Gid:   1000    1000    1000    1000
     FDSize:        128
     Groups:        4 24 27 30 46 116 126 127 1000
     NStgid:        288605
     NSpid: 288605
     NSpgid:        153351
     NSsid: 153351
     VmPeak:         8625096 kB
     VmSize:         4626800 kB
     VmLck:        0 kB
     VmPin:        0 kB
     VmHWM:   194540 kB
     VmRSS:   125928 kB
     RssAnon:          38616 kB
     RssFile:          87292 kB
     RssShmem:            20 kB
     VmData:          267896 kB
     VmStk:      132 kB
     VmExe:   112352 kB
     VmLib:        0 kB
     VmPTE:      844 kB
     VmSwap:               0 kB
     HugetlbPages:         0 kB
     CoreDumping:   1
     THP_enabled:   1
     Threads:       20
     SigQ:  0/47179
    SigPnd:        0000000000000000
     ShdPnd:        0000000000000000
     SigBlk:        0000000000000000
     SigIgn:        0000000000000002
     SigCgt:        00000001800010f8
     CapInh:        0000000000000000
     CapPrm:        0000000000000000
     CapEff:        0000000000000000
     CapBnd:        0000003fffffffff
     CapAmb:        0000000000000000
     NoNewPrivs:    0
     Seccomp:       0
     Speculation_Store_Bypass:      thread vulnerable
     Cpus_allowed:  f
     Cpus_allowed_list:     0-3
     Mems_allowed:  00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000>
     Mems_allowed_list:     0
     voluntary_ctxt_switches:       11320
     nonvoluntary_ctxt_switches:    4009
    Signal: 11
    Uname: Linux 5.4.0-54-generic x86_64
    UserGroups: adm cdrom dip kvm lpadmin plugdev sambashare sudo
    

    INFO

    I am running (dualboot) Ubuntu 20.04.1 LTS on Acer Spin 3 with 12gb ram, Intel® Core™ i7-7500U CPU @ 2.70GHz × 4, and Mesa Intel® HD Graphics 620 (KBL GT2).

    Gnome version: 3.36.3

    Running journalctl -b -1 -e reveals:

    dec 05 14:16:12 urh-laptop mtp-probe[466455]: bus: 1, device: 11 was not an MTP device
    dec 05 14:16:14 urh-laptop systemd[1]: run-snapd-ns-snap\x2dstore.mnt.mount: Succeeded.
    dec 05 14:16:14 urh-laptop systemd[1]: Unmounted /run/snapd/ns/snap-store.mnt.
    dec 05 14:16:14 urh-laptop systemd[1]: Unmounting /run/snapd/ns...
    dec 05 14:16:14 urh-laptop systemd[1]: run-snapd-ns.mount: Succeeded.
    dec 05 14:16:14 urh-laptop systemd[1]: Unmounted /run/snapd/ns.
    dec 05 14:16:14 urh-laptop systemd[1]: Stopped target Local File Systems (Pre).
    dec 05 14:16:14 urh-laptop systemd[1]: Stopped target Swap.
    dec 05 14:16:14 urh-laptop systemd[1]: Deactivating swap /dev/disk/by-id/ata-ST1000LM035-1RK172_WES1A7S2-part3...
    dec 05 14:16:14 urh-laptop systemd[1]: systemd-tmpfiles-setup-dev.service: Succeeded.
    dec 05 14:16:14 urh-laptop systemd[1]: Stopped Create Static Device Nodes in /dev.
    dec 05 14:16:14 urh-laptop systemd[1]: systemd-sysusers.service: Succeeded.
    dec 05 14:16:14 urh-laptop systemd[1]: Stopped Create System Users.
    dec 05 14:16:14 urh-laptop systemd[1]: systemd-remount-fs.service: Succeeded.
    dec 05 14:16:14 urh-laptop systemd[1]: Stopped Remount Root and Kernel File Systems.
    dec 05 14:16:14 urh-laptop systemd[1]: Reached target Shutdown.
    dec 05 14:16:15 urh-laptop systemd[1]: dev-disk-by\x2dpath-pci\x2d0000:00:17.0\x2data\x2d1\x2dpart3.swap: Succeeded.
    dec 05 14:16:15 urh-laptop systemd[1]: Deactivated swap /dev/disk/by-path/pci-0000:00:17.0-ata-1-part3.
    dec 05 14:16:15 urh-laptop systemd[1]: dev-disk-by\x2did-ata\x2dST1000LM035\x2d1RK172_WES1A7S2\x2dpart3.swap: Succeeded.
    dec 05 14:16:15 urh-laptop systemd[1]: Deactivated swap /dev/disk/by-id/ata-ST1000LM035-1RK172_WES1A7S2-part3.
    dec 05 14:16:15 urh-laptop systemd[1]: dev-disk-by\x2did-wwn\x2d0x5000c5009d10879a\x2dpart3.swap: Succeeded.
    dec 05 14:16:15 urh-laptop systemd[1]: Deactivated swap /dev/disk/by-id/wwn-0x5000c5009d10879a-part3.
    dec 05 14:16:15 urh-laptop systemd[1]: dev-disk-by\x2dpartuuid-00af4d5c\x2d43e1\x2d4918\x2d8b9e\x2d8f331d86bab4.swap: Succeeded.
    dec 05 14:16:15 urh-laptop systemd[1]: Deactivated swap /dev/disk/by-partuuid/00af4d5c-43e1-4918-8b9e-8f331d86bab4.
    dec 05 14:16:15 urh-laptop systemd[1]: dev-sda3.swap: Succeeded.
    dec 05 14:16:15 urh-laptop systemd[1]: Deactivated swap /dev/sda3.
    dec 05 14:16:15 urh-laptop systemd[1]: dev-disk-by\x2duuid-86c68832\x2d3661\x2d488d\x2db520\x2dbb94356b7b1f.swap: Succeeded.
    dec 05 14:16:15 urh-laptop systemd[1]: Deactivated swap /dev/disk/by-uuid/86c68832-3661-488d-b520-bb94356b7b1f.
    dec 05 14:16:15 urh-laptop systemd[1]: Reached target Unmount All Filesystems.
    dec 05 14:16:15 urh-laptop systemd[1]: Reached target Final Step.
    dec 05 14:16:15 urh-laptop systemd[1]: systemd-poweroff.service: Succeeded.
    dec 05 14:16:15 urh-laptop systemd[1]: Finished Power-Off.
    dec 05 14:16:15 urh-laptop systemd[1]: Reached target Power-Off.
    dec 05 14:16:15 urh-laptop systemd[1]: Shutting down.
    dec 05 14:16:15 urh-laptop systemd-shutdown[1]: Syncing filesystems and block devices.
    dec 05 14:16:16 urh-laptop systemd-shutdown[1]: Sending SIGTERM to remaining processes...
    dec 05 14:16:16 urh-laptop systemd-journald[272]: Journal stopped
    

    urh@urh-laptop:/var/crash$ free -h
                  total        used        free      shared  buff/cache   available
    Mem:           11Gi       1,6Gi       7,2Gi       330Mi       2,8Gi       9,3Gi
    Swap:         9,3Gi          0B       9,3Gi
    

    urh@urh-laptop:/var/crash$ sysctl vm.swappiness
    vm.swappiness = 60
    

    urh@urh-laptop:/var/crash$ sudo dmidecode -s bios-version
    [sudo] password for urh: 
    V1.04
    

    urh@urh-laptop:/$ grep -i swap /etc/fstab
    # swap was on /dev/sdb3 during installation
    UUID=86c68832-3661-488d-b520-bb94356b7b1f none            swap    sw              0       0
    

    urh@urh-laptop:/$ ls -al /usr/share/gnome-shell/extensions
    total 20
    drwxr-xr-x 5 root root 4096 nov  3 00:39 .
    drwxr-xr-x 7 root root 4096 nov  3 01:33 ..
    drwxr-xr-x 2 root root 4096 nov  3 00:39 desktop-icons@csoriano
    drwxr-xr-x 3 root root 4096 nov  2 22:03 [email protected]
    drwxr-xr-x 3 root root 4096 dec  1 18:17 [email protected]
    

    Ubutnu 18 never crashed. I am a noob, so i cant make anything usefull from crash reporst. I can also provide stuff from /var/log/

    Update #1

    swapon

    urh@urh-laptop:~$ swapon --show
    NAME      TYPE      SIZE USED PRIO
    /dev/sda3 partition 9,3G   0B   -2
    

    urh@urh-laptop:~$ sudo blkid
    [sudo] password for urh: 
    /dev/sda3: UUID="86c68832-3661-488d-b520-bb94356b7b1f" TYPE="swap" PARTUUID="00af4d5c-43e1-4918-8b9e-8f331d86bab4"
    /dev/sda2: UUID="ac6f5269-f799-4b38-a91a-3688bd842038" TYPE="ext4" PARTUUID="8e1ba2b7-fc9d-4fbc-bbb3-a00170fd283c"
    /dev/loop0: TYPE="squashfs"
    /dev/loop1: TYPE="squashfs"
    /dev/loop2: TYPE="squashfs"
    /dev/loop3: TYPE="squashfs"
    /dev/loop4: TYPE="squashfs"
    /dev/loop5: TYPE="squashfs"
    /dev/loop6: TYPE="squashfs"
    /dev/loop7: TYPE="squashfs"
    /dev/sda1: LABEL="Podatki" UUID="16161663161643E1" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="ce22c83a-64d0-4091-9773-b65d637375e6"
    /dev/sda4: UUID="77ea92d2-e175-4648-a977-726e2ebae872" TYPE="ext4" PARTUUID="da5c0b1c-0285-4717-a98d-e280babb0044"
    /dev/sdb1: LABEL="System Reserved" UUID="A620DA0620D9DCFD" TYPE="ntfs" PARTUUID="9abd075d-01"
    /dev/sdb2: UUID="F4D8E4B1D8E47372" TYPE="ntfs" PARTUUID="9abd075d-02"
    /dev/sdb3: UUID="26AED78EAED754C1" TYPE="ntfs" PARTUUID="9abd075d-03"
    /dev/loop8: TYPE="squashfs"
    /dev/loop9: TYPE="squashfs"
    

    urh@urh-laptop:~$ cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    # / was on /dev/sdb2 during installation
    UUID=ac6f5269-f799-4b38-a91a-3688bd842038 /               ext4    errors=remount-ro 0       1
    # /home was on /dev/sdb4 during installation
    UUID=77ea92d2-e175-4648-a977-726e2ebae872 /home           ext4    defaults        0       2
    # swap was on /dev/sdb3 during installation
    UUID=86c68832-3661-488d-b520-bb94356b7b1f none            swap    sw              0       0
    /dev/disk/by-uuid/16161663161643E1 /mnt/Podatki auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Podatki 0 0
    /dev/disk/by-uuid/F4D8E4B1D8E47372 /mnt/dataFromWindows auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Data%20From%20Windows 0 0
    

    drwxrwsrwt  2 root     whoopsie     4096 dec  5 15:18 .
    drwxr-xr-x 14 root     root         4096 apr 25  2020 ..
    -rw-r--r--  1 kernoops whoopsie     2787 dec  1 15:57 linux-image-5.4.0-54-generic.203356.crash
    -rw-r--r--  1 kernoops whoopsie     2922 nov 29 19:45 linux-image-5.4.0-54-generic.213157.crash
    -rw-r-----  1 root     whoopsie  1072334 dec  5 15:05 _opt_teamviewer_tv_bin_teamviewerd.0.crash
    -rw-r--r--  1 root     whoopsie        0 dec  2 17:13 _opt_teamviewer_tv_bin_teamviewerd.0.upload
    -rw-------  1 whoopsie whoopsie       37 dec  2 17:13 _opt_teamviewer_tv_bin_teamviewerd.0.uploaded
    -rw-r-----  1 urh      whoopsie 63037944 nov 30 19:57 _usr_bin_gnome-shell.1000.crash
    -rw-r--r--  1 urh      whoopsie        0 nov 30 19:57 _usr_bin_gnome-shell.1000.upload
    -rw-------  1 whoopsie whoopsie       37 nov 30 19:57 _usr_bin_gnome-shell.1000.uploaded
    -rw-r-----  1 urh      whoopsie 74784629 dec  1 14:01 _usr_share_code_code.1000.crash
    -rw-r-----  1 urh      whoopsie 74784631 dec  5 15:18 _usr_share_code_code.1000.crash.save
    -rw-r--r--  1 urh      whoopsie        0 dec  1 14:01 _usr_share_code_code.1000.upload
    -rw-------  1 whoopsie whoopsie       37 dec  1 14:01 _usr_share_code_code.1000.uploaded
    

    Model: Acer Spin 3

    Model Number: N16P9

    Update #2

    Serial number: NXGK9AA0216480116F7200

    SNID: 64800446372

    Update #3

    urh@urh-laptop:~$ ls -al ~/.local/share/gnome-shell/extensions
    ls: cannot access '/home/urh/.local/share/gnome-shell/extensions': No such file or directory
    

    urh@urh-laptop:~$ ls -al /usr/share/gnome-shell/extensions
    total 20
    drwxr-xr-x 5 root root 4096 nov  3 00:39 .
    drwxr-xr-x 7 root root 4096 nov  3 01:33 ..
    drwxr-xr-x 2 root root 4096 nov  3 00:39 desktop-icons@csoriano
    drwxr-xr-x 3 root root 4096 nov  2 22:03 [email protected]
    drwxr-xr-x 3 root root 4096 dec  1 18:17 [email protected]
    

    Update #4 - SOLUTION? As suggested by @heynnema , I updated the BIOS. (anoyingly Acer only produces updates for windows, so that was fun). I also added intel_idle.max_cstate=1 in /etc/default/grub and the crashing have stopped for now.

    The hint for changing grub was in error code bug soft lockup CPU#2 stuck for 23 s, which only showed one time when crashing. (Usually the screen just went black without showing the log).

  • Urh
    Urh over 3 years
    It has been some time without crashing, so I am willing to accept this as answer. I cant tell what exactly solved the problem, updated bios or edited grub. Apparently similar problems occur with Nvidia hardware. (I have intel)
  • Boris Hamanov
    Boris Hamanov over 3 years
    It would be instructive to remove "intel_idle.max_cstate=1 processor.max_cstate=1", and sudo update-grub, reboot, and see if the crashes return. That way we'll know if it was the BIOS that fixed the problem, or the GRUB that fixed the problem. I don't think that the GRUB fixed all of the various crashes that you were having. You did the BIOS part of my answer, please also do the "memory" part of my answer. Report back.
  • Urh
    Urh over 3 years
    Update for @heynnema . After removing "intel_idle.max_cstate=1 processor.max_cstate=1", the system crashed again. I already did a memory part, and passed the tests. But i must emphasize, that i waited longer for the crash to happen (before, this was a daily thing). So in a worst case, there could be differend crashings going on, and BIOS + grub solved it? But i DO NOT see the reason WHY does the grub method work.
  • Boris Hamanov
    Boris Hamanov over 2 years
    Sorry, but I'm out of ideas.