Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] Kernel lockup

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
segviolate
Posts: 3
Joined: 2023-03-31 12:24

[Software] Kernel lockup

#1 Post by segviolate »

I realize this is a bit general, but have there been any reports of kernel lockups with Debian 11? I have a system that runs fine on Debian 10, but I'm experiencing random lockups running it on Debian 11. There isn't a kernel panic displayed, everything becomes unresponsive and I have to do a hard reboot of the machine. Examining the logs post reboot shows no indication of an issue. The system is using kernel 5.10.0-21-amd64, on an Intel i5-8500 and Q370 chipset.

Barring any reports of this issue, I'm looking for ideas as to how I can wedge myself into the system when it's in this state, so that I can get some useful information.

Aki
Global Moderator
Global Moderator
Posts: 2929
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 72 times
Been thanked: 401 times

Re: [Software] Kenel lockup

#2 Post by Aki »

Hello,
You can try the REISUB sequence [1] to shutdown the operative system in a controlled way. This could allow you to save data in the system log before the shutdown.

[1] https://en.wikipedia.org/wiki/Magic_SysRq_key
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1399
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 46 times
Been thanked: 68 times

Re: [Software] Kenel lockup

#3 Post by None1975 »

Aki wrote: 2023-03-31 15:21 Hello,
You can try the REISUB sequence
Magic keys tend to be disabled in Debian these days, so you can't just hard-reboot your machine or kill all your X processes by pressing a few keys accidentally.
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

Aki
Global Moderator
Global Moderator
Posts: 2929
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 72 times
Been thanked: 401 times

Re: [Software] Kenel lockup

#4 Post by Aki »

Hello,
None1975 wrote: 2023-03-31 16:12
Aki wrote: 2023-03-31 15:21 Hello,
You can try the REISUB sequence
Magic keys tend to be disabled in Debian these days, so you can't just hard-reboot your machine or kill all your X processes by pressing a few keys accidentally.
Thank you for your remarks.

According to [1]:
Since the Etch release, the Magic SysRq key feature is enabled in the Linux kernel to allow console users certain privileges. You can confirm this by checking if the /proc/sys/kernel/sysrq exists and reviewing its value:

Code: Select all

$ cat /proc/sys/kernel/sysrq 
438
For example, on my Debian Bullseye (stable, 11.6) (I'm currently running 5.10.0-16-amd64, I know, it's not the latest version for current stable):

Code: Select all

$ cat /proc/sys/kernel/sysrq
438
According to [2] the bit mask in /proc/sys/kernel/sysrq is:

Code: Select all

  2 =   0x2 - enable control of console logging level
  4 =   0x4 - enable control of keyboard (SAK, unraw)
  8 =   0x8 - enable debugging dumps of processes etc.
 16 =  0x10 - enable sync command
 32 =  0x20 - enable remount read-only
 64 =  0x40 - enable signalling of processes (term, kill, oom-kill)
128 =  0x80 - allow reboot/poweroff
256 = 0x100 - allow nicing of all RT tasks
Decimal 438 equals binary 110110110 , therefore are active by default in Debian the following SYSRQ features:

Code: Select all

  2 =   0x2 - enable control of console logging level
  4 =   0x4 - enable control of keyboard (SAK, unraw)
 16 =  0x10 - enable sync command
 32 =  0x20 - enable remount read-only
128 =  0x80 - allow reboot/poweroff
256 = 0x100 - allow nicing of all RT tasks
These should be enough to "gently" (as far as possible) shutdown the system (if the kernel responds to the SYSRQ sequence).

If you want to enable on the fly the dumps of processes:

Code: Select all

  8 =   0x8 - enable debugging dumps of processes etc.
it is possible to issue the command:

Code: Select all

su -l -c "echo 446 > /proc/sys/kernel/sysrq"
or modify /etc/sysctl.conf and update the initramfs.

---
[1] https://www.debian.org/doc/manuals/secu ... rq.it.html
[2] https://www.kernel.org/doc/html/latest/ ... sysrq.html
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Aki
Global Moderator
Global Moderator
Posts: 2929
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 72 times
Been thanked: 401 times

Re: [Software] Kernel lockup

#5 Post by Aki »

@segviolate: besides the REISUB sequence, you can check if the terminal console is active and, if yes, you can try to enter there and issue some commands to shutdown the system and/or read system logs to understand what's happening. You can activate the terminal console pressing simultaneously the keys CTRL+ALT+F2 , (e.g. terminal console number 2).
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

segviolate
Posts: 3
Joined: 2023-03-31 12:24

Re: [Software] Kernel lockup

#6 Post by segviolate »

I've tried the alternate terminal via alt - F[0-9] but I'm not able to get another terminal session.

Aki
Global Moderator
Global Moderator
Posts: 2929
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 72 times
Been thanked: 401 times

Re: [Software] Kernel lockup

#7 Post by Aki »

Hello,
segviolate wrote: 2023-03-31 18:23 I've tried the alternate terminal via alt - F[0-9] but I'm not able to get another terminal session.
If the graphical environment is running, the key sequence to activate the console terminal is CTRL-ALT-F[0-9].

Have you tried the REISUB sequence ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

segviolate
Posts: 3
Joined: 2023-03-31 12:24

Re: [Software] Kernel lockup

#8 Post by segviolate »

Aki wrote: 2023-03-31 18:27 If the graphical environment is running, the key sequence to activate the console terminal is CTRL-ALT-F[0-9].

Have you tried the REISUB sequence ?
I mis-typed and forgot the ctrl. I haven't had a lockup since I learned of the Magic SysRq key sequence. It will be the first thing I try if it happens again.

CynicalDebian
Posts: 263
Joined: 2023-03-02 05:26
Location: USA
Has thanked: 50 times
Been thanked: 60 times
Contact:

Re: [Software] Kernel lockup

#9 Post by CynicalDebian »

Usually lockups or freezes are because of running out of memory, it might be good to leave 'top' running in the background to see if you can spot a memory hog culprit. If you aren't experienced with top, 'htop' is a prettier version that I find easier to understand that is available in the repos.
Be seeing you...

Aki
Global Moderator
Global Moderator
Posts: 2929
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 72 times
Been thanked: 401 times

Re: [Software] Kernel lockup

#10 Post by Aki »

CynicalDebian wrote: 2023-03-31 19:09 Usually lockups or freezes are because of running out of memory [..]
In this case, you should see the disk continuously spinning if ram swap is configured.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
sunrat
Administrator
Administrator
Posts: 6461
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: [Software] Kernel lockup

#11 Post by sunrat »

segviolate wrote: 2023-03-31 12:31 Examining the logs post reboot shows no indication of an issue.
Which logs were you looking at?

Code: Select all

journalctl -b -1 -p 3
should show errors for the previous boot. Use -p 4 to show warnings as well, or omit -p for the full journal log.

Aki wrote: 2023-03-31 18:27 Hello,
segviolate wrote: 2023-03-31 18:23 I've tried the alternate terminal via alt - F[0-9] but I'm not able to get another terminal session.
If the graphical environment is running, the key sequence to activate the console terminal is CTRL-ALT-F[0-9].

Have you tried the REISUB sequence ?
If you want to switch to a text terminal, use F2-F6. F7-F12 are Xserver instances, typically default is F7. A good reference is at - https://calcoen.web.cern.ch/Linux_keys.htm

Magic SysReq keys (eg. REISUB) can be reconfigured as well but 438 should be enough. The value of 438 is obtained from the sum of 2 + 4 + 16 + 32 + 128 + 256, so all the corresponding functions are enabled.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Aki
Global Moderator
Global Moderator
Posts: 2929
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 72 times
Been thanked: 401 times

Re: [Software] Kernel lockup

#12 Post by Aki »

@segviolate: have you any update on the topic ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply