Of course, I will share the reproduction steps later. In fact, it has nothing to do with character width. The reason for adding Chinese characters here is to cache them using the grub_font_get_glyph() function. If the caching is not done here, when the grub_print_error() function is called later on, it will enter the grub_font_get_glyph()function. Then at the caching check in grub_font_get_glyph_internal(), it will fail, which will lead to the execution of the read_be_uint16() behavior. In the read behavior, the receive_packets() function will be called, which in turn calls the grub_print_error() function. At this point, a looping behavior of calling the grub_print_error() function from within itself is formed.
I tested this on the grub-2.12 release version. First, you need to set the BIOS boot option to PXE. Then, add these two lines in grub.cfg: "set lang=zh_CN" and "terminal_output gfxterm". After that, you can add a grub_error print statement in the grub_initrd_init function in the linux.c file, so you can see the error context. I look forward to your reply. At 2024-08-30 02:57:18, "Vladimir 'phcoder' Serbinenko" <phco...@gmail.com> wrote: Chinese characters are not normal width. In fact they are twice normal width in most cases. Can you first update to the latest upstream release and of the issue still persists then share exact reproduction steps? Le jeu. 29 août 2024, 16:28, chenwj <18362375...@163.com> a écrit : Hi, I have found an error scenario that leads to an infinite printing loop. This scenario requires the following two commands to be present in grub.cfg: "set lang=zh_CN" and "terminal_output gfxterm", and it must also be retrieved through PXE. Attached is the patch to fix the issue. Thank you for your attention, and I look forward to your response. You can reach me through this email. Chen Weijie Tel: 18362375558