From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JwmD2-00008S-0e for mharc-grub-devel@gnu.org; Thu, 15 May 2008 18:46:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JwmD0-00007T-MH for grub-devel@gnu.org; Thu, 15 May 2008 18:45:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JwmCy-00007H-LW for grub-devel@gnu.org; Thu, 15 May 2008 18:45:57 -0400 Received: from [199.232.76.173] (port=53134 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwmCy-00007E-G3 for grub-devel@gnu.org; Thu, 15 May 2008 18:45:56 -0400 Received: from c60.cesmail.net ([216.154.195.49]:31520) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1JwmCx-0005cL-VW for grub-devel@gnu.org; Thu, 15 May 2008 18:45:56 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 15 May 2008 18:45:54 -0400 Received: from [192.168.1.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id B0109619058 for ; Thu, 15 May 2008 18:45:53 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <200805120915.01236.isaacmarcos100010@gmail.com> References: <200805080454.54578.isaacmarcos100010@gmail.com> <200805091213.27785.isaacmarcos100010@gmail.com> <1210366588.14815.11.camel@dv> <200805120915.01236.isaacmarcos100010@gmail.com> Content-Type: text/plain Date: Thu, 15 May 2008 18:45:52 -0400 Message-Id: <1210891552.2360.35.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: grub-probe gets a segfault 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, 15 May 2008 22:45:58 -0000 On Mon, 2008-05-12 at 09:14 -0430, Isaac M. Marcos wrote: > (gdb) print mda_size > $1 = 192512 > > not what you though :-( OK, we have something interesting here. mda_size is 192512 (0x2f000). rlocn->offset is 92672 (0x16a00). But (q - metadatabuf) is 325120 (0x4f600). So, the initial value of q was within the buffer, but the value that caused the segfault was outside the buffer. It means that GRUB could not find any space character in the buffer and kept scanning until it hit unallocated space. I believe it's not valid LVM metadata. > $ sudo pvck /dev/sda6 > Device /dev/sda6 not found (or ignored by filtering). So, it's not a LVM physical volume. > /dev/sda6 3397 6561 25422831 fd Linux raid autodetect It's a RAID partition. I guess RAID partitions have a different layout. The fix would be to reject RAID partitions in grub_lvm_scan_device(). The only validity check in that function is presence of the LVM label in the first 4 sectors. Perhaps additional checks are needed. -- Regards, Pavel Roskin