From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KOhpA-0000ML-Ax for mharc-grub-devel@gnu.org; Thu, 31 Jul 2008 19:44:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOhp8-0000Lh-Qd for grub-devel@gnu.org; Thu, 31 Jul 2008 19:44:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOhp6-0000Kl-NG for grub-devel@gnu.org; Thu, 31 Jul 2008 19:44:46 -0400 Received: from [199.232.76.173] (port=37638 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOhp6-0000Kf-Ad for grub-devel@gnu.org; Thu, 31 Jul 2008 19:44:44 -0400 Received: from main.gmane.org ([80.91.229.2]:55531 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KOhp6-0005Db-0F for grub-devel@gnu.org; Thu, 31 Jul 2008 19:44:44 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KOhoy-0001w4-90 for grub-devel@gnu.org; Thu, 31 Jul 2008 23:44:36 +0000 Received: from cable-87-78-192-2.netcologne.de ([87.78.192.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Jul 2008 23:44:36 +0000 Received: from patrick by cable-87-78-192-2.netcologne.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Jul 2008 23:44:36 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: grub-devel@gnu.org From: Patrick Georgi Date: Fri, 01 Aug 2008 01:44:53 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cable-87-78-192-2.netcologne.de User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) Sender: news X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: two bugs in configfile parser X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2008 23:44:47 -0000 Hi, given the following grub.cfg (simplified test case): menuentry "test" { if test "a" = "a" ; then echo foo fi } I have some issues. To reproduce, load grub with that file, enter the editor on the menu item, run it with ctrl-x. Two things can happen (I have some local patches which lead to one happening slightly more often than the other, so it seems to be quite sensitive to $whatever): 1. it crashes on malloc magic problems. It seems to be related to the leading spaces on "echo foo". If I remove them, it works. I guess, they're skipped at some place, and after that, the string should be grub_free()d. grub's mm doesn't support that. 2. it corrupts the text once it finishes. After removing the leading spaces, it runs correctly and returns to the editor. Unfortunately, starting with " echo foo", the text is corrupted. Another run (with all those garbage strings) ends in malloc magic error. That code runs fine if executed directly from the menu. Regards, Patrick Georgi