Bug#903661: [cfdisk]: Assertion `end > start' failed. Aborted

2018-08-03 Thread Andreas Henriksson
Control: tags -1 + moreinfo upstream

Hello Jeff Cliff,

Thanks for your bug report. (Reply inline below.)

On Thu, Jul 12, 2018 at 12:48:47PM -0400, Jeff Cliff wrote:
> Package: util-linux
> Version: 2.29.2-1+deb9u1
> Severity: normal
> 
> Dear Maintainer,
> 
> when trying to use cfdisk to view the partitions on a USB thumb drive
> with an image of a ChromeOS recovery disk on it ( specifically
> chromeos_10176.76.0_terra_recovery_stable-channel_mp-v2.bin )

Is there anywhere I can download this file?

> instead of cfdisk running, cfdisk merely prints out
> 
> cfdisk: libfdisk/src/table.c:409: new_freespace: Assertion `end > start' 
> failed.
>   
>   Aborted
> 
> and does not run any further.

There's not very much information here to go on. Could you please
atleast run with debug messages enabled? Could you try with a more
recent version of (c)fdisk (like from testing/unstable)?

> 
> fdisk can load this disk -
> fdisk /dev/sdb , p gives:
> 
> Disk /dev/sdb: 3.8 GiB, 4048551936 bytes, 7907328 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: gpt
> Disk identifier: FADF1998-E292-1A43-975C-0BF190FDC25F
> 
> Device   Start End Sectors  Size Type
> /dev/sdb1  4415488 4435967   20480   10M Microsoft basic data
> /dev/sdb220480   53247   32768   16M ChromeOS kernel
> /dev/sdb3   319488 4415487 40960002G ChromeOS root fs
> /dev/sdb453248   86015   32768   16M ChromeOS kernel
> /dev/sdb5   315392  31948740962M ChromeOS root fs
> /dev/sdb616448   16448   1  512B ChromeOS kernel
> /dev/sdb716449   16449   1  512B ChromeOS root fs
> /dev/sdb886016  118783   32768   16M Microsoft basic data
> /dev/sdb916450   16450   1  512B ChromeOS reserved
> /dev/sdb10   16451   16451   1  512B ChromeOS reserved
> /dev/sdb11  64   16447   163848M unknown
> /dev/sdb12  249856  315391   65536   32M EFI System

Thanks for the comparison point. This likely means it's not a bug
in libfdisk, but rather in the application (cfdisk) itself.
The assertion is in libfdisk though so cfdisk likely mixes up the
information and then passes wrong info back into libfdisk.

> 
> Partition table entries are not in disk order.
> 
> Command (m for help):
> 
> lsusb gives
> Bus 005 Device 002: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly 
> Feiya Technology Corp.) Flash Drive
> 
> 
> While it's plausible that ChromeOS has made some kind of mangled filesystem, 
> or even that the disk

No matter how corrupt the file is, there should never be assertion
failures.

> itself has bad sectors(??) ...in both cases cfdisk should behave differently
> 1) if the disk is bad, it should say as much
> 2) if it's ChromeOS's filesystem which is not written properly, it should 
> load a screen much like fdisk does anyway,
> or present the option to do something about the situation(format?)
> 
> 
> 
> 
> 
> -- System Information:
> Debian Release: 9.4
>   APT prefers stable-updates
>   APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.9.0-6-amd64 (SMP w/2 CPU cores)
> Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), 
> LANGUAGE=en_CA:en (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages util-linux depends on:
> ii  libblkid1  2.29.2-1+deb9u1
> ii  libc6  2.24-11+deb9u3
> ii  libfdisk1  2.29.2-1+deb9u1
> ii  libmount1  2.29.2-1+deb9u1
> ii  libncursesw5   6.0+20161126-1+deb9u2
> ii  libpam0g   1.1.8-3.6
> ii  libselinux12.6-3+b3
> ii  libsmartcols1  2.29.2-1+deb9u1
> ii  libsystemd0232-25+deb9u3
> ii  libtinfo5  6.0+20161126-1+deb9u2
> ii  libudev1   232-25+deb9u3
> ii  libuuid1   2.29.2-1+deb9u1
> ii  zlib1g 1:1.2.8.dfsg-5
> 
> util-linux recommends no packages.
> 
> Versions of packages util-linux suggests:
> pn  dosfstools  
> ii  kbd 2.0.3-2+b1
> ii  util-linux-locales  2.29.2-1+deb9u1
> 
> -- no debconf information
> 


Regards,
Andreas Henriksson



Bug#903661: [cfdisk]: Assertion `end > start' failed. Aborted

2018-07-12 Thread Jeff Cliff
Package: util-linux
Version: 2.29.2-1+deb9u1
Severity: normal

Dear Maintainer,

when trying to use cfdisk to view the partitions on a USB thumb drive with an 
image of a ChromeOS recovery disk on it
( specifically  chromeos_10176.76.0_terra_recovery_stable-channel_mp-v2.bin )
instead of cfdisk running, cfdisk merely prints out

cfdisk: libfdisk/src/table.c:409: new_freespace: Assertion `end > start' failed.

Aborted

and does not run any further.

fdisk can load this disk -
fdisk /dev/sdb , p gives:

Disk /dev/sdb: 3.8 GiB, 4048551936 bytes, 7907328 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FADF1998-E292-1A43-975C-0BF190FDC25F

Device   Start End Sectors  Size Type
/dev/sdb1  4415488 4435967   20480   10M Microsoft basic data
/dev/sdb220480   53247   32768   16M ChromeOS kernel
/dev/sdb3   319488 4415487 40960002G ChromeOS root fs
/dev/sdb453248   86015   32768   16M ChromeOS kernel
/dev/sdb5   315392  31948740962M ChromeOS root fs
/dev/sdb616448   16448   1  512B ChromeOS kernel
/dev/sdb716449   16449   1  512B ChromeOS root fs
/dev/sdb886016  118783   32768   16M Microsoft basic data
/dev/sdb916450   16450   1  512B ChromeOS reserved
/dev/sdb10   16451   16451   1  512B ChromeOS reserved
/dev/sdb11  64   16447   163848M unknown
/dev/sdb12  249856  315391   65536   32M EFI System

Partition table entries are not in disk order.

Command (m for help):

lsusb gives
Bus 005 Device 002: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya 
Technology Corp.) Flash Drive


While it's plausible that ChromeOS has made some kind of mangled filesystem, or 
even that the disk
itself has bad sectors(??) ...in both cases cfdisk should behave differently
1) if the disk is bad, it should say as much
2) if it's ChromeOS's filesystem which is not written properly, it should load 
a screen much like fdisk does anyway,
or present the option to do something about the situation(format?)





-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_CA:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages util-linux depends on:
ii  libblkid1  2.29.2-1+deb9u1
ii  libc6  2.24-11+deb9u3
ii  libfdisk1  2.29.2-1+deb9u1
ii  libmount1  2.29.2-1+deb9u1
ii  libncursesw5   6.0+20161126-1+deb9u2
ii  libpam0g   1.1.8-3.6
ii  libselinux12.6-3+b3
ii  libsmartcols1  2.29.2-1+deb9u1
ii  libsystemd0232-25+deb9u3
ii  libtinfo5  6.0+20161126-1+deb9u2
ii  libudev1   232-25+deb9u3
ii  libuuid1   2.29.2-1+deb9u1
ii  zlib1g 1:1.2.8.dfsg-5

util-linux recommends no packages.

Versions of packages util-linux suggests:
pn  dosfstools  
ii  kbd 2.0.3-2+b1
ii  util-linux-locales  2.29.2-1+deb9u1

-- no debconf information