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

2016-03-30 Thread Alvaro Gonzalez
URL:
  

 Summary: GRUB 2.02~beta2 "fatal error: token too large,
exceeds YYLMAX"
 Project: GNU GRUB
Submitted by: lvarin
Submitted on: Wed 30 Mar 2016 08:37:10 AM GMT
Category: Booting
Severity: Major
Priority: 5 - Normal
  Item Group: Software Error
  Status: None
 Privacy: Public
 Assigned to: None
 Originator Name: 
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Release: 
 Release: other
 Reproducibility: Every Time
 Planned Release: None

___

Details:

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"




___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub


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

2016-03-30 Thread Andrei Borzenkov
Follow-up Comment #1, bug #47569 (project grub):

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?


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub


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

2016-04-04 Thread Alvaro Gonzalez
Follow-up Comment #2, bug #47569 (project grub):

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

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub


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

2016-04-08 Thread Andrei Borzenkov
Follow-up Comment #3, bug #47569 (project grub):

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?

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub


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

2017-03-05 Thread Vladimir Serbinenko
Update of bug #47569 (project grub):

 Planned Release:None => 2.03+  


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub


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

2016-03-30 Thread Vladimir 'phcoder' Serbinenko
We can add longjmp/setjmp to recover from such errors more gracefully

Le mer. 30 mars 2016 15:06, Andrei Borzenkov  a
écrit :

> Follow-up Comment #1, bug #47569 (project grub):
>
> 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?
>
>
> ___
>
> Reply to this item at:
>
>   
>
> ___
>   Message sent via/by Savannah
>   http://savannah.gnu.org/
>
>
> ___
> Bug-grub mailing list
> Bug-grub@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-grub
>
___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub