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"

Submitted by:  Alvaro Gonzalez <lvarin>
Submitted on:  Wed 30 Mar 2016 08:37:10 AM UTC  
 
Category: BootingSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenRelease: 
Release: otherReproducibility: 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>
Project 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>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 05 Mar 2017 08:29:42 PM UTCphcoderPlanned ReleaseNone=>2.03+

    Back to the top


    Powered by Savane 3.1-cleanup1