Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MTfb7-0007fv-PE for mharc-grub-devel@gnu.org; Wed, 22 Jul 2009 13:27:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTfb5-0007eE-IB for grub-devel@gnu.org; Wed, 22 Jul 2009 13:27:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTfb0-0007b0-HK for grub-devel@gnu.org; Wed, 22 Jul 2009 13:27:18 -0400 Received: from [199.232.76.173] (port=42045 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTfb0-0007ag-0a for grub-devel@gnu.org; Wed, 22 Jul 2009 13:27:14 -0400 Received: from mx20.gnu.org ([199.232.41.8]:46301) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTfax-00085T-Tv for grub-devel@gnu.org; Wed, 22 Jul 2009 13:27:12 -0400 Received: from aybabtu.com ([69.60.117.155]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTfax-0006Tm-3o for grub-devel@gnu.org; Wed, 22 Jul 2009 13:27:11 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MTeVB-00078p-9b for grub-devel@gnu.org; Wed, 22 Jul 2009 18:17:09 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MTfav-0002KT-5T for grub-devel@gnu.org; Wed, 22 Jul 2009 19:27:09 +0200 Date: Wed, 22 Jul 2009 19:27:09 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090722172709.GF8706@thorin> References: <8FB98151-B0A2-4308-A065-15607AE9E8D8@gmail.com> <20090718185800.GJ8867@thorin> <0CC61931-97E9-4B53-8B86-37129AE84218@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0CC61931-97E9-4B53-8B86-37129AE84218@gmail.com> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Clear out gfxterm's virtual text_buffer - fixes junk at end of lines 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: Wed, 22 Jul 2009 17:27:19 -0000 On Sat, Jul 18, 2009 at 03:39:00PM -0700, Joe Auricchio wrote: > > On 18 Jul, 2009, at 11:58 , Robert Millan wrote: >> On Sat, Jul 18, 2009 at 12:15:04AM -0700, Joe Auricchio wrote: >>> >>> This fixes a 100% reproducible and very annoying bug I've found: >>> Switch >>> to gfxterm and until your clear the screen or scroll, the last >>> position >>> of every line has a random junk character in random foreground and >>> background color. I believe the root cause is that the >>> virtual_screen's >>> text_buffer is uninitialized; as the cursor reaches a new position, >>> the >>> uninitialized junk data is drawn to the screen. Really, the entire >>> screen >>> is junk, but it's never marked dirty so it's never drawn. So let's >>> just >>> clear out the whole text_buffer when we set up the screen. >> >> But grub_virtual_screen_free() already set the whole structure to 0 at >> the >> beginning of grub_virtual_screen_setup(). >> >> Does a zero-filled screen result in garbage, or is something else >> overwriting >> it? > > grub_virtual_screen_free sets all of virtual_screen to 0, but not > virtual_screen.text_buffer. text_buffer just gets grub_freed. Later in > grub_virtual_screen_setup, a new text_buffer is grub_malloced. It's this > new text_buffer that my patch clears out. So perhaps this can be solved simpler by replacing grub_malloc with grub_zalloc ? -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."