[Parted-maintainers] Bug#819488: libparted2: parted crash with a libparted backtrace

Antos Andras antos at cs.bme.hu
Tue Jun 12 03:42:12 BST 2018


Package: libparted2
Version: 3.2-17
Followup-For: Bug #819488

I also confirm this bug still exists. Here is the output of

# fdisk -l -u /dev/sda
Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x1baf0215

Device     Boot    Start       End   Sectors   Size Id Type
/dev/sda1           2048  10567679  10565632     5G 83 Linux
/dev/sda3  *    10567680  31930287  21362608  10,2G 83 Linux
/dev/sda4       31930366 976771071 944840706 450,5G  5 Extended
/dev/sda5  *    31932416  48338943  16406528   7,8G 83 Linux
/dev/sda6       48338944  52535295   4196352     2G 82 Linux swap / Solaris
/dev/sda7       52537344 976771071 924233728 440,7G 83 Linux

Partition 4 does not start on physical sector boundary.

Indeed, there is no unallocated sector between my logical partitions 
sda5 and sda6.
  If I recall correctly, I have used only fdisk, cfdisk and/or Debian/Ubuntu
installers (using parted itself?) to manipulate the partition table.
I have not used any Windows tool.

Here upstream maintainers discuss if it is actually a bug:
https://lists.gnu.org/archive/html/bug-parted/2015-09/msg00021.html
I also consider it an important bug. (Any program aborting and suggesting 
to report a bug instead of executing a basic functionality, by definiton, 
has a bug.) Parted should instead handle the partition table and give a 
warning about the non-standard EBR arrangement. Or if it cannot be made 
robust enough to handle such partition table (though, this does not look 
impossible), it should at least give a proper error message about that, 
rather than abort with a failure.

Btw, there are now quite a lot reports about this:
https://google.com/search?q=Assertion+add_logical_part_metadata+failed ,
some of which blaming parted of fdisk for the "non-standard" EBR arrangement,
e.g.:
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1543704/comments/13
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1543704/comments/14

Is there any advance with the fix? Is there plans for a new upstream release?

FYI, here is the output of
# parted /dev/sda print
and
# parted /dev/sda unit co print unit s print
Backtrace has 14 calls on stack:
   14: /lib/x86_64-linux-gnu/libparted.so.2(ped_assert+0x45) [0x7fd2a2274fc5]
   13: /lib/x86_64-linux-gnu/libparted.so.2(+0x23b3f) [0x7fd2a228bb3f]
   12: /lib/x86_64-linux-gnu/libparted.so.2(+0x119fa) [0x7fd2a22799fa]
   11: /lib/x86_64-linux-gnu/libparted.so.2(ped_disk_add_partition+0x283) [0x7fd2a227a313]
   10: /lib/x86_64-linux-gnu/libparted.so.2(+0x233ec) [0x7fd2a228b3ec]
   9: /lib/x86_64-linux-gnu/libparted.so.2(+0x23480) [0x7fd2a228b480]
   8: /lib/x86_64-linux-gnu/libparted.so.2(+0x23426) [0x7fd2a228b426]
   7: /lib/x86_64-linux-gnu/libparted.so.2(+0x24455) [0x7fd2a228c455]
   6: /lib/x86_64-linux-gnu/libparted.so.2(ped_disk_new+0x48) [0x7fd2a2279f18]
   5: parted(+0x73fe) [0x55a4b69f33fe]
   4: parted(non_interactive_mode+0x92) [0x55a4b69f91c2]
   3: parted(main+0x12bf) [0x55a4b69f207f]
   2: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7fd2a1a722e1]
   1: parted(_start+0x2a) [0x55a4b69f224a]


You found a bug in GNU Parted! Here's what you have to do:

Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:

Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:

         http://ftp.gnu.org/gnu/parted/

Please check this version prior to bug reporting.

If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:

         http://www.gnu.org/software/parted

for further information.

Your report should contain the version of this release (3.2)
along with the error message below, the output of

         parted DEVICE unit co print unit s print

and the following history of commands you entered.
Also include any additional information about your setup you
consider important.

Assertion (metadata_length > 0) at ../../../libparted/labels/dos.c:2313 in
function add_logical_part_metadata() failed.

Aborted 
-----------
And here is the first 4 sectors of my extended partition (with EBRs?) 
omitting the 0-only lines:

# dd if=/dev/sda skip=31930366 count=4 2>/dev/null|xxd |grep -v "0000 0000 0000 0000 0000 0000 0000 0000"

000001b0: 0000 0000 0000 0000 0000 0000 0000 80b2  ................
000001c0: f0c3 83f4 f4c0 0208 0000 0058 fa00 0092  ...........X....
000001d0: d0c3 052b 25c6 0200 0000 0068 3a01 0000  ...+%......h:...

000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.

000005b0: 0000 0000 0000 0000 0000 0000 0000 00fe  ................
000005c0: ffff 82fe ffff 0060 fa00 0008 4000 002b  .......`.... at ..+
000005d0: 26c6 052f 6e81 0268 3a01 00b8 1637 0000  &../n..h:....7..

000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.


Thanks,
Andras

-- System Information:
Debian Release: 9.4
   APT prefers stable-updates
   APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 'stable'), (100, 'stretch')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.16.0-0.bpo.2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libparted2 depends on:
ii  libblkid1           2.29.2-1+deb9u1
ii  libc6               2.24-11+deb9u3
ii  libdevmapper1.02.1  2:1.02.137-2
ii  libuuid1            2.29.2-1+deb9u1

libparted2 recommends no packages.

Versions of packages libparted2 suggests:
pn  libparted-dev   <none>
pn  libparted-i18n  <none>
ii  parted          3.2-17

-- no debconf information



More information about the Parted-maintainers mailing list