#1006774 freeze on the first keypress

Package:
grub-pc
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (PC/BIOS version)
Submitter:
Eduard Bloch
Date:
2023-08-21 14:57:02 UTC
Severity:
important
#1006774#5
Date:
2022-03-04 19:13:00 UTC
From:
To:
Hi,

strange things here. My workstation is using EFI CSM (legacy) mode,
rootfs is on a SATA SSD (MBR parttable), there is also an unrelated NVME
SSD involved.
This has been working for years. Had to replace the CPU recently, which
caused a few hickups, resetting mainboard CMOS, etc.. Now suddenly I
cannot use the GRUB menu anymore. First keystroke freezes GRUB, the
timeout stops ticking.

This happened with grub 2.06, so I downgraded to 2.04 after seeing your
blocker ticket. Didn't make any difference, same freezing.

I googled already, tried different values of GRUB_TERMINAL_INPUT
(usb_keyboard, at_keyboard) and running update-grub afterwards. And no
help, the issue remains.

I tried booting our netinst which apparently comes up in EFI mode and
keyboard navigation works there very well.

That sounds similar to #538381 but it's from another age, and might be
unrelated.

Chipset: AMD AM4, B450, Gigabyte board

Best Regards,
Eduard.

#1006774#10
Date:
2022-03-23 21:10:31 UTC
From:
To:
I have encountered numerous time the same behavior: grub freezing after first
keypress.

What happened in my case was that for repairing a system, I wanted to switch to
the second menu entry "advanced options" in order to boot in recovery. So I
pressed the down key.
Instead of having the second entry highlighted, the selection went all the way
down to last entry (i.e. memory check), and then grub froze. No other key would
work and I would be forced to shut the computer down using the power switch.

Years ago, this already happened to me numerous times, and at that time was
solved by using a different keyboard, i.e. to use a wired keyboard with the old
round violet plug. I do not have this keyboard and now only have USB keyboards,
wireless ones (Logitech MXkeys, Logitech K230) and a wired one (cheap noname).
All these keyboards exhibits the same behavior.

Upon further investigation, it seems to me that grubs receives duplicated
keystrokes. If for example instead of pressing the down key to select a non-
default menu entry I press the "c" key to get command line, grubs switches
properly to a new page with a "grub>" prompt, and a line full of "c" after the
prompt. If I press backspace to remove one "c", I remove all of them. If I
press any other letter like "f", I get perhaps 40 or 80 "f" in the line. I
cannot edit anything. As this happens with all USK keyboards I tried, even a
brand new one bought specially for the purpose and never used before, I don't
think that the keyboards are faulty with bouncing keys. Also after boot, in
regular operations, all these keyboards work properly and don't bounce.

This problem is very serious to me. It completely prevents recovering a broken
system. I *cannot* boot in recovery mode. In fact, I cannot boot in anything
except default mode, carefully taking care of not touching my keyboard at all
during grub initialization.

#1006774#15
Date:
2022-04-09 12:04:39 UTC
From:
To:
Hi all,

Here are some more informations about this bug.

I can confirm it happens on USB keyboard and it does not
happen on PS/2 keyboard.

I purchased an old used PS/2 keyboard on ebay to check.
With this keyboard plugged on the PS/2 socket of
the motherboard, everything workd fine. At boot time,
I can press the arrow keys to select menu entries in
Grub at will. When I have highlighted the entry I want,
pressing enter runs this entry, as expected.

I tried also some mixed settings, as both the Logitech
MX Keys with a wireless USB dongle and the old PS/2
keyboard were plugged when booting. In this setting,
if I use the PS/2 keyboard arrow keys to change selection,
it works. Then, I switch to the USB keybord and try to
also use the arrow keys. Freeze occurs immediately, at
the first press of a key from the USB keyboard. Once
grub is frozen, if I attempt to use the PS/2 keyboard
again, nothing happens, grub remains frozen and I have to
use the power switch to shut down the computer.

Note that the problem does not occur on a notebook
with an integrated keyboard, even if I use the wireless
USB keyboard instead of the notebook keyboard.

So the only workaround I found for using the grub menu
on a desktop PC was to purchase an old PS/2 keyboard,
and not touch at all the USB keyboard while grub is
active.

best regards,
Luc

#1006774#20
Date:
2022-11-25 09:37:00 UTC
From:
To:
A few months later, the problem is still there. Current version is
2.06-5.

The repeating keys for USB keybords make grub completely impossible
to use. Some new checks starting with using 'c' as the first keystroke
showed that the repetition is random. Some time I get 10 characters
repeated, sometimes I get more than 80 characters filling one line and
an half on the screen.

This is really a serious problem, please consider looking at it.

Luc

#1006774#25
Date:
2023-08-21 14:46:18 UTC
From:
To:
The bug is still present in grub 2.06-13.
It however seems to happen only with some motherboard/CPU
configurations.
Here are 3 different configurations I had to test recently:

  - motherboard MSI X570-A PRO, CPU AMD Ryzen 5 3600
         bug occurs: boot freezes as soon as one key is pressed
                     on a USB keyboard due to repeated key, only
                     way to select menu is to use an old keyboard
  - motherboard ASrock Q87M vPro, CPU Intel core I7 5820K
         no bug: can select boot menu entries from USB keyboard
  - motherboard ASUS H170 pro gaming, CPU Intel core I7-6700
         no bug: cas select boot menu entries from USB keyboard

Every other components in the PC were exactly the same: I just mounted
the motherboard/CPU in the same box at a few days interval

Luc