Intermittant failures to create msdos extended partitions on disks with 4k sectors due to a bug in libparted

Bug #1610628 reported by Wesley Wiedenmeier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin
Confirmed
Undecided
Unassigned

Bug Description

When attempting to format a disk with a dos partition table using an extended partition there are occasional crashes that appear to be caused by a bug in parted. This only happens when disks are using 4k sectors. It seems to happen whether using scsi-hd or virtio-blk in qemu.

This only happens maybe 1/5 times, and only seems to happen when many tests are being run concurrently, suggesting that it has something to do with disk read/write times. However, I have not been able to narrow down the cause yet. While this is a bug in parted, and curtin is calling parted correctly here, I'm filing a bug against curtin as well because I know ideally curtin will no longer use parted at some point in the future. I will file a bug in parted upstream once I have created a test case that causes this failure reliably without using curtin.

This failure was originally found in lp:~wesley-wiedenmeier/curtin/clear-holders-storagetests/ but in order to reproduce it without using storagetests, I have added vmtests that isolate dos logical partitioning and run both with 512 and 4K sector sizes in the branch
lp:~wesley-wiedenmeier/curtin/dos_extended_partition_vmtest/

The error message:

[ 22.622692] cloud-init[2389]: previous partition number for 'disk1extended' found to be '2'
[ 22.632965] cloud-init[2389]: previous partition: /sys/class/block/vdb/vdb2
[ 22.637165] cloud-init[2389]: previous partition.size_sectors: 524288.0
[ 22.654718] cloud-init[2389]: previous partition.start_sectors: 786688.0
[ 22.670006] cloud-init[2389]: adding partition 'disk1extended' to disk 'disk1' (ptable: 'msdos')
[ 22.684773] cloud-init[2389]: partnum: 3 offset_sectors: 1310976.0 length_sectors: 1049343
[ 22.712750] cloud-init[2389]: Running command ['parted', '/dev/vdb', '--script', 'mkpart', 'extended', '1310976 .0s', '2360319.0s'] with allowed return codes [0] (shell=False, capture=True)
[ 23.040850] cloud-init[2389]: An error occured handling 'disk1extended': ProcessExecutionError Unexpected err or while running command.
[ 23.066064] cloud-init[2389]: Command: ['parted', '/dev/vdb', '--script', 'mkpart', 'extended', '1310976.0s', ' 2360319.0s']
[ 23.072602] cloud-init[2389]: Exit code: -11
[ 23.074978] cloud-init[2389]: Reason: -
[ 23.080224] cloud-init[2389]: Stdout: ''
[ 23.128547] cloud-init[2389]: Stderr: "\n\nYou found a bug in GNU Parted! Here's what you have to do:\n\nDon't panic! The bug has most likely not affected any of your data.\nHelp us to fix this bug by doing the following:\n\n Check whether the bug has already been fixed by checking\nthe last version of GNU Parted that you can find at:\n\n \thttp://ftp.gnu.org/gnu/parted/\n\nPlease check this version prior to bug reporting.\n\nIf this has not been fixe d yet or if you don't know how to check,\nplease visit the GNU Parted website:\n\n\thttp://www.gnu.org/software/pa rted\n\nfor further information.\n\nYour report should contain the version of this release (3.2)\nalong with the e rror message below, the output of\n\n\tparted DEVICE unit co print unit s print\n\nand the following history of co mmands you entered.\nAlso include any additional information about your setup you\nconsider important.\n"
[ 23.145099] cloud-init[2389]: finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: failed: conf iguring partition: disk1extended

Related branches

Changed in curtin:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.