#991263 libparted2: libparted assertion fails on resizing a certain sun partition table

Package:
libparted2
Source:
parted
Description:
disk partition manipulator - shared library
Submitter:
Rich Ercolani
Date:
2021-07-19 06:24:04 UTC
Severity:
normal
#991263#5
Date:
2021-07-19 06:20:52 UTC
From:
To:
Like it says on the tin - I noticed my drive's partition table was smaller than the drive,
tried to resizepart, and boom.

I'm assuming I input a somehow invalid value, but an assertion failure was not the outcome
I expected.

Entire chain of events:

$ sudo parted /dev/sda
GNU Parted 3.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Warning: The disk CHS geometry (139476,255,2) reported by the operating system does not match the geometry stored on the disk label (2549,255,63).
Ignore/Cancel? i
Model: SEAGATE ST336704LC (scsi)
Disk /dev/sda: 36.4GB
Sector size (logical/physical): 512B/512B
Partition Table: sun
Disk Flags:

Number  Start   End     Size    File system  Flags
 1      0.00B   98.7MB  98.7MB  ext2         boot
 2      98.7MB  21.0GB  20.9GB               lvm

(parted) r
  align-check TYPE N                       check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted) resizepart 2 36.4GB
Error: Unable to satisfy all constraints on the partition.
(parted) resizepart 2 36.4G
Backtrace has 1 calls on stack:
  1: /lib/sparc64-linux-gnu/libparted.so.2(ped_assert+0x20) [0xfffff801001fa548]


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.4)
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 (bios_geom->cylinders == (PedSector) (dev->length / cyl_size)) at ../../../libparted/labels/sun.c:191 in function sun_alloc() failed.

Aborted

- Rich