bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parted crash accessing GPT table


From: Daniel Fandrich
Subject: Re: parted crash accessing GPT table
Date: Fri, 24 Jun 2011 15:12:03 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Jun 24, 2011 at 04:20:29PM +0200, Jim Meyering wrote:
> Thank you for the complete bug report.
> Here's the patch I'm about to push:

Thanks for looking at that problem so quickly. That patch does stop the
crash on that file presumably by rejecting all the partitions. Since sending
that last bug report I looked more closely at the partition table that was
generated and found a couple of off-by-one errors in the table entries.
The attached file contains a fixed partition table which should now
be internally consistent.

The patched parted now cleanly rejects both files as-is. But if they are
length extended to match the internal LBA sizes, parted crashes in a new
way.  The attached file can be length extended with the command:

dd if=/dev/zero of=ptest seek=2700001 bs=512 count=1

The file I sent yesterday can be extended with the command:

dd if=/dev/zero of=ptable seek=31031293 bs=512 count=1

The backup GPT is detected as corrupt as expected, since it's at the end
of the zero-extended device. Here's the crash dump of parted-3.0 with the
patch on the attached file:

$ /var/tmp/parted-3.0/parted/parted ptest unit co print unit s print
WARNING: You are not superuser.  Watch out for permissions.
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
parted: invalid token: unit
OK/Cancel? ok
Backtrace has 13 calls on stack:
  13: /var/tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_assert+0x31) 
[0x7f5f858094c1]
  12: 
/var/tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_geometry_read+0x80) 
[0x7f5f85810240]
  11: 
/var/tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_geometry_read_alloc+0x54)
 [0x7f5f85810514]
  10: /var/tmp/parted-3.0/libparted/.libs/libparted.so.1(nilfs2_probe+0x8d) 
[0x7f5f85818ccd]
  9: 
/var/tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_file_system_probe_specific+0x5c)
 [0x7f5f8580a87c]
  8: 
/var/tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_file_system_probe+0x83) 
[0x7f5f8580a973]
  7: /var/tmp/parted-3.0/libparted/.libs/libparted.so.1(+0x244d7) 
[0x7f5f858214d7]
  6: /var/tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_disk_new+0x75) 
[0x7f5f8580f9e5]
  5: /var/tmp/parted-3.0/parted/.libs/lt-parted() [0x405e59]
  4: /var/tmp/parted-3.0/parted/.libs/lt-parted(non_interactive_mode+0x8c) 
[0x40a7bc]
  3: /var/tmp/parted-3.0/parted/.libs/lt-parted(main+0xd6e) [0x40800e]
  2: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xff) [0x7f5f85001eff]
  1: /var/tmp/parted-3.0/parted/.libs/lt-parted() [0x404bf9]
Aborted

parted doesn't seem to like that command line ("invalid token: unit") which
I got from parted's assert error output from yesterday (is a documentation
change needed there?) but pretty well all commands I tried caused similar
crashes.

>>> Dan
-- 
Daniel Fandrich
Embedded Developer
Intrinsyc Software, Inc.
10th Floor, 700 West Pender
Vancouver, BC  V6C 1G8
604-801-6461
fax: 604-801-6417
http://www.intrinsyc.com

Attachment: ptest
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]