Find root cause of complete freezes

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
thecursedfly

Find root cause of complete freezes

Post by thecursedfly »

Hi,

Since I installed Linux Mint 18.3 Cinnamon 64-bit on my laptop (a GPD Pocket requiring a kernel with some tweaks for its hardware) I get complete freezes at random times, for which I have no other chance than to hard shutdown with the power button.
So, with your help, I would like to analyze the root cause and take appropriate measures if possible.

Additional info:
  • it happens about once per day, but sometimes more times in short distance (for example yesterday while watching the same online video)
  • usually I cannot reproduce it realiably by watching the same video or performing the same actions
  • yesterday I could reproduce it after using the following command to get a system log until the last moment (hoped that would help me investigate): dmesg -T --follow > mydmesg.log
    the file is here: http://dcdrops.com/files/mydmesg.log
    I cannot immediately see something troublesome but I'm not an expert. The log is quite short because I had just restarted the laptop after the previous crash.
  • inxi details: http://dcdrops.com/files/inxi.txt
  • what happens is that I am using the laptop normally (no heavy tasks, usually just internet browsing, sometimes a youtube video playing, perhaps some music in VLC) and suddenly any video or UI freezes, the mouse doesn't move anymore, cannot use the Ctrl+Alt+Fx combinations to get to console, if there is audio playing it continues in a loop of 0.5-1 seconds
  • when it doesn't freeze, it all works wonderfully
  • don't know if it's related, but when it happens I have it always connected (it's the way I use this laptop when not traveling) to an external fullHD screen via microHDMI, USB-C hub with power in and external keyboard and mouse, 3.5mm speakers jack - I could try to use the laptop for some time without all these attached to see if it still happens, but i cannot reliably reproduce the problem
Are there any additional logs I can check in search for errors?
The Xorg log is quite unreadable with its time stamps, but from what I gather it contains only details from after the crash. /var/log/kern.log contains the same details at the end as mydmesg.log I linked above.

Any suggestions?

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mattyboy

Re: Find root cause of complete freezes

Post by Mattyboy »

It may be because Cinnamon is to heavy for your machine. Not knowing your computers basic specifications its difficult to comment further. Providing the results of this terminal command will certainly help here.

Code: Select all

inxi -Fxz
EDIT: My bad I missed your txt file.

As explained below its probably the Kernel. Ubuntu 18.04 beta ships with the 4.15 kernel if you need a newer one for hardware support. Failing that you may have to wait a little longer until stable release versions with 4.16 are out.
Last edited by Mattyboy on Thu Mar 29, 2018 7:53 am, edited 1 time in total.
User avatar
kc1di
Level 18
Level 18
Posts: 8181
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Find root cause of complete freezes

Post by kc1di »

the first place I would look is at the Kernel:

Code: Select all

4.16.0-rc3-stockmind-gpdpocket x86_64 (64 bit gcc: 7.2.0)
.

4.16.0 is not an Ubuntu/mint kernel revert to kernel 4.13 or even 4.4 for now and see if the crashes are resolved.
you should not go outside the kernels of Ubuntu - Ubuntu adds it's own tweaks to the kernel and Mint uses the Ubuntu kernel system , kernel 4.15 will be in Mint 19 sometime this summer. Unless there is an overwhelming need for the newer kernel - Hardware support- then you should always stick to the current kernel in mint.
here is a rundown on Ubuntu kernel numbering system:
https://wiki.ubuntu.com/Kernel/Support

Good Luck.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
thecursedfly

Re: Find root cause of complete freezes

Post by thecursedfly »

Without that kernel this laptop has several issues (drivers, screen rotation, audio, usb-c, etc...), so changing kernel isn't really an option.

In the meantime I have reproduced the problem without any attachments (screen, keyb, mouse...), so it's either the laptop itself or software.

It's not a problem of the laptop having too low specs as the usage is very low when it occurs, and playing a video usually works without problems. But lately it seems to happen mainly while watching videos so I'm suspecting some issue with overheating (although it's not so hot at touch?) or something to do with the intel graphics card.
User avatar
kc1di
Level 18
Level 18
Posts: 8181
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Find root cause of complete freezes

Post by kc1di »

you should be able to see the temp of the Processor with

Code: Select all

inxi -s
if it's a temp problem it will show up there if there are sensors in the machine.
you may also want to install a program like psensor that will monitor heat readings and display them for you.
good luck.
P.S. I don't usually tell people this on mint but if you absolutely need the latest kernels you may be better off with a more cutting edge distro such as manjaro which makes 4.16 rc7 available at present. They also offer a community spin with Cinnamon DE if that's what you like.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
thecursedfly

Re: Find root cause of complete freezes

Post by thecursedfly »

Seems like I have found a youtube video where I can reproduce the issue quite easily...
Happened again while playing the video [ https://www.youtube.com/watch?v=AVXRMu3kThw ] in the background, with psensor open in foreground, so that I coud take a screenshot of the temperatures:
www.dcdrops.com/files/IMG_20180329_153650s.jpg

Any idea whether these are very high?
thecursedfly

Re: Find root cause of complete freezes

Post by thecursedfly »

The problem could be due to the BIOS version and DPTF. I am currently using the unlocked BIOS for the laptop where all kinds of settings can be tweaked; this BIOS version seems to be a bit unstable compared to the latest locked versions.
However the real cause seems to be DPTF; for now I have disabled DPTF and am unable to reproduce the freeze even while running two fullHD youtube videos at the same time. Psensor temperatures rise to 75 degees C, but don't rise more. Will see during the next coupe days if it really fixed the problem.
User avatar
kc1di
Level 18
Level 18
Posts: 8181
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Find root cause of complete freezes

Post by kc1di »

75 C is quite hot. Good luck.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
ShellCode33

Re: Find root cause of complete freezes

Post by ShellCode33 »

I have the exact same problem. My laptop runs Linux Mint 18.3 with kernel 4.13.0-41 under KDE Plasma.
I don't have any GPU, just an Intel CPU. I also have an SSD (I don't know if it's relevant but I have seen many people having freezing issues and having an SSD).
I have been able to reproduce the bug, on my computer it seams that the freezing occurs when watching a video AFTER RESUMING FROM SUSPEND.
I thought the problem was the hardware acceleration (even though I don't have any GPU) but I tried to disable it from my brower and it kept freezing...
Moreover, when powering off the computer after a freeze, sometimes when I turn it back on, the screen stays black and I have to manually turn it off again...

Good luck trying to find out what's wrong ^^
User avatar
zpangwin
Level 1
Level 1
Posts: 21
Joined: Sun Mar 04, 2018 2:21 am
Location: Southeast U.S.
Contact:

Re: Find root cause of complete freezes

Post by zpangwin »

Found this thread while looking for another issue but I think I know what was going on, even if I'm several years late to the party. I don't care whatsoever about "necroing" threads like this: if they come up in google searches and don't have a clear resolution, I consider them fair game bc it might actually *help* someone else, even if it's too late for OP.

That said, I had similar issues to this on another PC (it was an older ASRock htcore mini pc) that also had integrated Intel graphics. I still happened to have the debug notes for that pc as well as the solution I used so I will post them here to avoid the relevant xkcd.

Code: Select all

$ inxi -F
System:
  Host: htpc Kernel: 5.3.0-28-generic x86_64 bits: 64 
  Desktop: Cinnamon 4.4.8 Distro: Linux Mint 19.3 Tricia 
Machine:
  Type: Desktop Mobo: ASRock model: HM65-HT serial: <root required> 
  BIOS: American Megatrends v: P1.10 date: 08/22/2011 
CPU:
  Topology: Dual Core model: Intel Core i5-2520M bits: 64 type: MT MCP 
  L2 cache: 3072 KiB 
  Speed: 798 MHz min/max: 800/3200 MHz Core speeds (MHz): 1: 880 2: 1032 
  3: 842 4: 865 
Graphics:
  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics 
  driver: i915 v: kernel 
  Display: x11 server: X.Org 1.19.6 driver: modesetting unloaded: fbdev,vesa 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa DRI Intel Sandybridge Mobile v: 3.3 Mesa 19.2.8 
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio 
  driver: snd_hda_intel 
  Sound Server: ALSA v: k5.3.0-28-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  driver: r8169 
  IF: enp2s0 state: down mac: <redacted>
  Device-2: Qualcomm Atheros AR9287 Wireless Network Adapter driver: ath9k 
  IF: wlp5s0 state: down mac: <redacted>
  Device-3: ASIX AX88179 Gigabit Ethernet type: USB driver: ax88179_178a 
  IF: enx00249b16b185 state: up speed: 1000 Mbps duplex: full 
  mac: <redacted>
  IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
Drives:
  Local Storage: total: 1.36 TiB used: 867.19 GiB (62.1%) 
  ID-1: /dev/sda vendor: Western Digital model: <redacted>
  size: 465.76 GiB 
  ID-2: /dev/sdb vendor: Western Digital model: <redacted>
  size: 931.51 GiB 
Partition:
  ID-1: / size: 453.78 GiB used: 35.73 GiB (7.9%) fs: ext4 dev: /dev/sda1 
  ID-2: swap-1 size: 3.72 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 
Sensors:
  System Temperatures: cpu: 48.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 200 Uptime: 38m Memory: 3.57 GiB used: 1.64 GiB (45.9%) 
  Shell: bash inxi: 3.0.32 
  
Root Cause:

In my case, it was related to the Intel CPU idle state (e.g. how the kernel managed my specific hardware - and this applied on other distros as well. I know for certain I had the issue under several major versions of Mint as well as under Fedora. I think I also encountered it under a Manjaro livedisc too).

Confirming:

If you have an older Intel cpu targeted at smaller builds or laptops and are getting random freezes, check your c-state with cat /sys/module/intel_idle/parameters/max_cstate. If you have 6 or 9 or really anything higher than 1, then it might be worth trying the solution to see if it works (you can always use the same steps to revert it if it does not solve your crashes). Do note that since it is changing cpu idle state, you will probably incur higher battery usage but IMO this is better than random freezes, especially if you generally use it while connected to a power outlet.

Solution:

Make a backup of your grub file with sudo cp -a /etc/default/grub /etc/default/grub.$(date +'%Y-%m-%d_%H%M%S').bak just in case. Then you will need to open the file as root with some kind of text editor and modify the GRUB_CMDLINE_LINUX line as shown and save the file. If you are not comfortable using vi or nano with sudo, then you can open Nemo ("Files" in the "start" menu) and browse to "File system" > /etc > then right-click on the "default" folder and choose "Open as root". In the root instance of Nemo, make sure you are in /etc/default then right-click on the "grub" file and choose Open with > Text editor. This should open it in the xed text-editor unless you have changed preferences to use something else.

If GRUB_CMDLINE_LINUX is empty then just replace the line with GRUB_CMDLINE_LINUX="intel_idle.max_cstate=1" and save. If you have some value in there already, first make sure there is no intel_idle.max_cstate=<some number>, if there is, then replace it with intel_idle.max_cstate=1. Otherwise, just add the new argument in front of the other arguments like so: GRUB_CMDLINE_LINUX="intel_idle.max_cstate=1 <old arguments>".

SAVE THE FILE then re-open it and confirm that your changes are there and they are correct (if you mess up Grub your system can become unbootable or at least very difficult to boot so it's worth spending a minute to CAREFULLY check that it has everything and there are no errors / typos).

Finally, you will need to have grub regenerate its config files (then reboot) for the changes to take effect. Most systems these days use UEFI instead of legacy BIOS mode for booting. But on older systems you might be more likely to find legacy BIOS mode. In many distros, the mode your OS is running in effects which command you need to run to regenerate grub. But for Ubuntu/Mint (maybe Debian also?), there is an "update-grub" command which simplifies this. I'm mentioning it bc on Fedora and some other distros this command does not exist and despite the forum, I prefer to give distro-agnostic solutions when possible.

On Mint, you can run: `sudo update-grub` then reboot the PC.

On NON-Mint/NON-Ubuntu-based distros (e.g. Fedora, OpenSUSE, Manjaro, etc), you'll first need to check if you are using BIOS or UEFI mode. If you have the folder /sys/firmware/efi then you are using UEFI mode; otherwise, you're probably using BIOS mode. For regenerating your Grub config under BIOS mode, the command will probably look something like this (I recommend googling "<your distro> regenerate grub <uefi or bios>" first to make sure): sudo grub2-mkconfig -o /boot/grub2/grub.cfg. Under UEFI, it might vary. My notes say I used sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg when I was on Fedora with UEFI but obviously that path is distro-specific; like with the BIOS command, you'll want to google for your distro specifically. Same as with Mint, once this command completes, reboot the pc.

Anyway, when the PC comes back up from reboot and you log in, you can confirm the change worked by rerunning cat /sys/module/intel_idle/parameters/max_cstate and checking that your idle state is now 1.

Sources:
Locked

Return to “Software & Applications”