Subject: Re: bug#21856: print bug in probe_filesystem_for_geom

From: "Brian C. Lane" <[email-masked]>
Date: Mon, 9 Nov 2015 15:09:09 -0800

On Sat, Nov 07, 2015 at 03:58:52PM -0500, Tim Kissane wrote:
> Greetings Parted devs,
> 
> While attempting to use parted to examine a USB (/dev/sdb), I tripped a bug
> message.  I hope this information proves helpful.
> My uneducated guess is that the function probe_filesystem_for_geom needs to
> validate input. Or perhaps I need to learn the right usage. ;)
> 
> ---
> (parted) print devices
> /dev/sda (480GB)
> /dev/sdb (2012MB)
> (parted) print sdb
> Backtrace has 11 calls on stack:
>   11: /lib/x86_64-linux-gnu/libparted.so.2(ped_assert+0x44) [0x7fc9e17cf644]
>   10: /lib/x86_64-linux-gnu/libparted.so.2(+0x1f0de) [0x7fc9e17e10de]
>   9: /lib/x86_64-linux-gnu/libparted.so.2(+0x1f1e7) [0x7fc9e17e11e7]
>   8: /lib/x86_64-linux-gnu/libparted.so.2(+0x209b8) [0x7fc9e17e29b8]
>   7: /lib/x86_64-linux-gnu/libparted.so.2(+0x120aa) [0x7fc9e17d40aa]
>   6: /lib/x86_64-linux-gnu/libparted.so.2(ped_disk_set_flag+0x68)
> [0x7fc9e17d46c8]
>   5: parted() [0x406b21]
>   4: parted(interactive_mode+0xff) [0x40ca2f]
>   3: parted(main+0x119f) [0x405f6f]
>   2: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)
> [0x7fc9e0fc6b45]
>   1: parted() [0x405fc7]
> 
> 
> You found a bug in GNU Parted! Here's what you have to do:
> ---
> Assertion (part->disk->dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0)
> at ../../../libparted/labels/dos.c:589 in function
> probe_filesystem_for_geom() failed.

Well, you aren't supposed to do 'print sdb' but it also shouldn't crash.
I couldn't reproduce this with parted-3.2-10.fc22.x86_64 on Fedora.
Commit eef3035 might have fixed it, but I'm not sure.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)