bugGNU GRUB - Bugs: bug #47569, GRUB 2.02~beta2 "fatal error:...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #47569: GRUB 2.02~beta2 "fatal error: token too large, exceeds YYLMAX"

Submitter:  Alvaro Gonzalez <lvarin>
Submitted:  Wed 30 Mar 2016 08:37:10 AM UTC
   
 
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  2.03+

Sat 09 Apr 2016 05:22:49 AM UTC, comment #3: 

We could also force %pointer (we require the latest flex anyway) which eliminates this error entirely. This can potentially lead to DoS if someone gives us too large input file.

Otherwise I'm not sure what logic should be. We start collecting string and hit "too long" error. What can we do now? Abort parsing of input file entirely?

Andrei Borzenkov <arvidjaar>
Group Member
Mon 04 Apr 2016 09:25:14 AM UTC, comment #2: 

Hello,

But couldn't grub recover from the error a bit better? It shows in a infinite loop (looks like infinite) the error:

"fatal error: token too large, exceeds YYLMAX"

...and it is impossible (as far as I know) to fix without booting from an different drive or similar to edit the config.

Could it just fail and leave you in a grub prompt? Bonus points if it lets you see the configuration you have and edit it. And more bonus points if the same parsing that it uses during boot to show the YYLMAX error is used in grub-mkconfig or a new grub-checkconfig is created.

Regards

Alvaro Gonzalez <lvarin>
Wed 30 Mar 2016 01:06:27 PM UTC, comment #1: 

Well, grub-mkconfig and /etc/default/grub are just shell scripts at the end. Not sure what we can do here. If shell does not complain, how should we know something went wrong?

Andrei Borzenkov <arvidjaar>
Group Member
Wed 30 Mar 2016 08:37:10 AM UTC, original submission:  

Hello,

I had two single quotes closing a variable in /etc/default/grub like this (due to copy paste mistake from me):

# head /etc/default/grub
#GRUB_DEFAULT=0
GRUB_DEFAULT='Arch Linux, with Linux linux''
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

When running grub-mkconfig with that configuration, this is the output:

# sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux-lts
Found initrd image: /boot/initramfs-linux-lts.img
Found fallback initramfs image: /boot/initramfs-linux-lts-fallback.img
Found linux image: /boot/vmlinuz-linux-git
Found initrd image: /boot/initramfs-linux-git.img
Found fallback initramfs image: /boot/initramfs-linux-git-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initramfs image: /boot/initramfs-linux-fallback.img
Found CentOS Linux release 7.2.1511 (Core)  on /dev/mapper/cc_pb--d--128--141--150--49-root
done


As you can see there is no error, but the resulting file has a missing double quote (at set default="Arch Linux, with Linux linux):

# sudo head /boot/grub/grub.cfg -n 25
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="Arch Linux, with Linux linux
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"


When booting an error is displayed in loop and the only option is to reboot:

"fatal error: token too large, exceeds YYLMAX"

Alvaro Gonzalez <lvarin>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Updated the item)
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by lvarin (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-05 phcoder Planned ReleaseNone 2.03+

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code