bug#49480: Assertion (!disk->update_mode) at disk.c:481 in function ped_disk_commit_to_dev() failed.
Ian Ormshaw <[email protected]> Fri, 9 Jul 2021 06:23:49 +0000
| Newsgroups | gmane.comp.gnu.parted.bugs |
|---|---|
| Message-ID | <CO6PR16MB4098FFE90317FE54AAC14152F7189@CO6PR16MB4098.namprd16.prod.outlook.com> |
The attached code causes an assertion to fail with the following output. device 0x15ea480 openStatus 1 disk 0x16019c0 diskCommitStatus 1 clobberStatus 1 Backtrace has 5 calls on stack: 5: /lib64/libparted.so.2(ped_assert+0x53) [0x7f45cfe82633] 4: /lib64/libparted.so.2(+0x1aa3b) [0x7f45cfe8ba3b] 3: ./disk(main+0x15c) [0x401392] 2: /lib64/libc.so.6(__libc_start_main+0xd5) [0x7f45cf94bb75] 1: ./disk(_start+0x2e) [0x40117e] A bug has been detected in GNU Parted. Refer to the web site of parted http://www.gnu.org/software/parted/parted.html for more information of what could be useful for bug submitting! Please email a bug report to [email protected] containing at least the version (3.4) and the following message: Assertion (!disk->update_mode) at disk.c:481 in function ped_disk_commit_to_dev() failed. Aborted I would thought expected if a disk cannot be used after a clobber that either the ped_disk_commit_to_dev call would return 0. Also, should the documentation for ped_disk_clobber state that no use of pre-existing disks should be made after clobber has been called, and that there is no need to commit the change as it as they appear to be committed to disk by the call to clobber. Ian Ormshaw, PhD Principal Software Engineer [cid:[email protected]] [T] +44 (0)161 946 2596 [W] www.waters.com<http://www.waters.com/> [E] [email protected]<mailto:[email protected]> Waters Limited Stamford Avenue Altrincham Road Wilmslow SK9 4AX UK [cid:[email protected]]<http://www.twitter.com/@WatersCorp>[cid:[email protected]]<http://www.linkedin.com/companies/waters>[cid:[email protected]]<http://www.facebook.com/Waters>[cid:[email protected]]<http://www.youtube.com/user/WatersCorporation> Waters Limited is registered in England under No 2912366. Registered office: 11 Old Jewry, London, EC2R 8DU, UK ====================================================================== The information in this email is confidential, and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized and therefore prohibited. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful.
image001.png
(image/png, 183 B) - not displayed
image002.png
(image/png, 166 B) - not displayed
image003.png
(image/png, 179 B) - not displayed
image007.png
(image/png, 179 B) - not displayed
image008.png
(image/png, 174 B) - not displayed
main.cpp
(text/plain, 1.3 KB)
#include <iostream>
#include <parted/parted.h>
#define TRIGGER_BUG
int main(int argc, char **argv)
{
const char* devicePath{"/dev/sdf"};
PedDevice* device = ped_device_get(devicePath);
std::cout << "device " << device << std::endl;
int openStatus{ped_device_open(device)};
std::cout << "openStatus " << openStatus << std::endl;
#if defined(TRIGGER_BUG)
PedDisk* disk{ped_disk_new(device)};
std::cout << "disk " << disk << std::endl;
int diskCommitStatus{ped_disk_commit(disk)};
std::cout << "diskCommitStatus " << diskCommitStatus << std::endl;
ped_disk_destroy(disk);
#endif // defined(TRIGGER_BUG)
int clobberStatus{ped_disk_clobber(device)};
std::cout << "clobberStatus " << clobberStatus << std::endl;
#if defined(TRIGGER_BUG)
int diskCommitToDeviceStatus{ped_disk_commit_to_dev(disk)};
std::cout << "diskCommitToDeviceStatus " << diskCommitToDeviceStatus << std::endl;
int diskCommitToOsStatus{ped_disk_commit_to_os(disk)};
std::cout << "diskCommitToOsStatus " << diskCommitToOsStatus << std::endl;
#endif // defined(TRIGGER_BUG)
int closeStatus{ped_device_close(device)};
std::cout << "closeStatus " << closeStatus << std::endl;
ped_device_destroy(device);
return 0;
}