GNOME Bugzilla – Bug 721988
Crash when creating new partition on disk with loop label
Last modified: 2014-02-19 17:51:14 UTC
While doing some testing I found this new way to crash GParted. 1) Write a new partition table of type loop to a disk; 2) Create a new partition on it. It effects GParted >= 0.16.2 with all versions of libparted. (Unless you have (lib)parted > 3.1 from the GIT repo [1] with Phillip Susi's pending patch [2] applied to fix loop labels). [1] GNU Parted GIT repository http://git.savannah.gnu.org/cgit/parted.git [2] bug#16231: [PATCH 1/2] Fix loop labels http://lists.gnu.org/archive/html/bug-parted/2014-01/msg00001.html I'm working on the fix. Thanks, Mike
Created attachment 266003 [details] [review] Prevent crash when creating new partition on loop label (v1) Hi Curtis, Here's the fix for this bug. Note that with this fix applied GParted returns to reporting an error for this test case, rather than crashing, just as it did for GParted <= 0.16.1, before this commit was applied: Clear btrfs file system super block mirror copies too (#705426) https://git.gnome.org/browse/gparted/commit/?id=246e05559d91865dd135690a62d56144f375c26b Addressing the "unrecognised disk label" error from libparted is what bug 683643 "Doesn't properly support partitionless drives" is all about. Thanks, Mike
Created attachment 266053 [details] [review] Prevent crash when creating new partition on loop label (v2) Hi Curtis, Here's v2 of the patch. Only changes the commit message a bit. Thanks, Mike
Created attachment 266083 [details] [review] Prevent crash when creating new partition on loop label (v3) Hi Mike, Thank you for discovering this crash situation and developing a patch. I was able to confirm the crash using GParted 0.17.0 to write a loop "partition table" to a disk device, and then trying to write a file system to the loop device. Using your patch (v2) I was able to confirm that the patch prevents GParted from crashing and instead permits display of a libparted error. The attached updated patch contains a minor change to the commit message. Specifically it changes: "the the" --> "to the" This patch (v3) passes my review. If you are content with the patch then please feel free to commit it to the master branch of the gnome git repository. Curtis
Hi Curtis, I've pushed the patch to the GParted GIT repository. Patch details: Prevent crash when creating new partition on loop label (#721988) https://git.gnome.org/browse/gparted/commit/?id=0e253fa234a16651e4c334b9599df016e7ed0cc7 Thanks, Mike
This enhancement was included in the GParted 0.18.0 release on February 19, 2014.