Intermittant failures to create msdos extended partitions on disks with 4k sectors due to a bug in libparted
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/
[ 22.637165] cloud-init[2389]: previous partition.
[ 22.654718] cloud-init[2389]: previous partition.
[ 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': ProcessExecutio
[ 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:
[ 23.145099] cloud-init[2389]: finish: cmd-install/
Related branches
- Wesley Wiedenmeier: Pending requested
-
Diff: 7081 lines (+4283/-1674)59 files modifiedMakefile (+3/-1)
curtin/__init__.py (+2/-0)
curtin/block/__init__.py (+4/-87)
curtin/commands/apply_net.py (+156/-1)
curtin/commands/block_meta.py (+0/-157)
curtin/commands/curthooks.py (+4/-51)
curtin/commands/main.py (+0/-6)
curtin/net/__init__.py (+67/-30)
curtin/net/network_state.py (+45/-1)
curtin/util.py (+10/-7)
doc/conf.py (+21/-4)
doc/devel/README-vmtest.txt (+0/-221)
doc/devel/README.txt (+0/-55)
doc/index.rst (+6/-0)
doc/topics/apt_source.rst (+26/-20)
doc/topics/config.rst (+551/-0)
doc/topics/development.rst (+68/-0)
doc/topics/integration-testing.rst (+245/-0)
doc/topics/networking.rst (+522/-0)
doc/topics/overview.rst (+7/-7)
doc/topics/reporting.rst (+3/-3)
doc/topics/storage.rst (+894/-0)
examples/network-ipv6-bond-vlan.yaml (+56/-0)
examples/tests/basic_network_static_ipv6.yaml (+22/-0)
examples/tests/network_alias.yaml (+125/-0)
examples/tests/network_mtu.yaml (+88/-0)
examples/tests/network_source_ipv6.yaml (+31/-0)
examples/tests/vlan_network_ipv6.yaml (+92/-0)
setup.py (+2/-2)
tests/storagetest_runner/test_advanced_format.py (+6/-0)
tests/storagetests/test_clear_holders.py (+44/-72)
tests/storagetests/test_format.py (+0/-2)
tests/storagetests/test_layers_on_mdadm.py (+3/-0)
tests/storagetests/test_raid.py (+3/-2)
tests/unittests/test_block.py (+0/-65)
tests/unittests/test_net.py (+54/-13)
tests/unittests/test_util.py (+111/-14)
tests/vmtests/__init__.py (+0/-19)
tests/vmtests/helpers.py (+129/-166)
tests/vmtests/image_sync.py (+0/-16)
tests/vmtests/test_basic.py (+17/-39)
tests/vmtests/test_bcache_basic.py (+5/-8)
tests/vmtests/test_bonding.py (+0/-205)
tests/vmtests/test_mdadm_bcache.py (+9/-11)
tests/vmtests/test_multipath.py (+5/-13)
tests/vmtests/test_network.py (+205/-352)
tests/vmtests/test_network_alias.py (+40/-0)
tests/vmtests/test_network_bonding.py (+63/-0)
tests/vmtests/test_network_enisource.py (+91/-0)
tests/vmtests/test_network_ipv6.py (+53/-0)
tests/vmtests/test_network_ipv6_enisource.py (+26/-0)
tests/vmtests/test_network_ipv6_static.py (+42/-0)
tests/vmtests/test_network_ipv6_vlan.py (+34/-0)
tests/vmtests/test_network_mtu.py (+155/-0)
tests/vmtests/test_network_static.py (+44/-0)
tests/vmtests/test_network_vlan.py (+77/-0)
tests/vmtests/test_raid5_bcache.py (+5/-8)
tests/vmtests/test_uefi_basic.py (+11/-16)
tox.ini (+1/-0)
Changed in curtin: | |
status: | New → Confirmed |