GParted crashes with Assertion (head_size <= 63)

Bug #545911 reported by TheBeest on 2010-03-24
172
This bug affects 42 people
Affects Status Importance Assigned to Milestone
gparted (Ubuntu)
Undecided
loue crow
Nominated for Natty by Phillip Susi
parted (Ubuntu)
Medium
Phillip Susi
Nominated for Natty by Phillip Susi

Bug Description

Binary package hint: gparted

I am trying to install Ubuntu 10.04 Beta 1 on my desktop from a USB flash drive created using unetbootin.
I can use everything in the live environment ok but when it comes to installing the install crashes when gparted tried to run. When running it from the terminal i get the following:

ubuntu@ubuntu:~$ sudo gparted

(gpartedbin:7282): GLib-GObject-WARNING **: cannot register existing type `gtkmm__GtkTextBuffer'
======================
libparted : 2.2
======================
Backtrace has 15 calls on stack:
  15: /lib/libparted.so.0(ped_assert+0x31) [0x7fceba7de831]
  14: /lib/libparted.so.0(+0x399b6) [0x7fceba8089b6]
  13: /lib/libparted.so.0(+0x3a123) [0x7fceba809123]
  12: /lib/libparted.so.0(+0x3adcd) [0x7fceba809dcd]
  11: /lib/libparted.so.0(ped_disk_add_partition+0x1cb) [0x7fceba7e4f3b]
  10: /lib/libparted.so.0(+0x3c1d6) [0x7fceba80b1d6]
  9: /lib/libparted.so.0(+0x3c385) [0x7fceba80b385]
  8: /lib/libparted.so.0(ped_disk_new+0x75) [0x7fceba7e5a15]
  7: /usr/sbin/gpartedbin() [0x44ab84]
  6: /usr/sbin/gpartedbin() [0x45645c]
  5: /usr/sbin/gpartedbin() [0x476c47]
  4: /usr/lib/libglibmm-2.4.so.1(+0x36812) [0x7fceb921d812]
  3: /lib/libglib-2.0.so.0(+0x67954) [0x7fceb8667954]
  2: /lib/libpthread.so.0(+0x69ca) [0x7fceb7ebe9ca]
  1: /lib/libc.so.6(clone+0x6d) [0x7fceb7c1d38d]
Assertion (head_size <= 63) at ../../../libparted/labels/dos.c:659 in function probe_partition_for_geom() failed.

As I cannot run gparted i cant install ubuntu to my hard drive so im stuck in the live environment.

ProblemType: Bug
Architecture: amd64
Date: Wed Mar 24 11:11:16 2010
DistroRelease: Ubuntu 10.04
LiveMediaBuild: Ubuntu 10.04 "Lucid Lynx" - Beta amd64 (20100318)
Package: gparted 0.5.1-1ubuntu2
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-16.25-generic
SourcePackage: gparted
Uname: Linux 2.6.32-16-generic x86_64

Related branches

TheBeest (thebeest) wrote :
TheBeest (thebeest) wrote :

After further investigation into this problem, I used the USB Startup Disk Creator on my laptop running Karmic to make another usb Lucid drive. This booted up fine and I was able to run gparted without errors.

TheBeest (thebeest) wrote :

By using the Ubuntu USB Startup Disk Creator I could partition my drive and am row running Lucid off the harddrive. So this is an issue with the way gparted treats (some) mounted media as there were only problems when unetbootin was used to create the disk.

zsquareplusc (zsquareplusc) wrote :

I have the same problem with the final release of Lucid. USB flash drive was written using the creator under Karmic (w/o formating the disk). The disk is formated FAT32 (by disk vendor) and worked without any problem under Ubuntu.

I was able to successfully run "sudo gparted /dev/sda" so it seems to have the problem with the USB flash drive. When it's supposed to show all drives (started w/o parameter) it crashes.

This is also a problem for the ubiquity installer as it just stops before showing page 4. It is not displaying an error message.

IMHO it is a fault of libparted to handle this as assertion error. Drives with properties it does not understand should be ignored/whatever but terminating like this disables the program completely.

what others do:
- fdisk -l is able to show information for the disk. fdisk's verify does not report a problem.
- cfdisk /dev/sdb reports an error about a broken partition table ("partition ends in the final partial cylinder"), program can only be exit.

This affects a usb install of netbook remix 10.04 made with the USB Startup Disk Creator on an ASUS 1000HE netbook. The install stalls after timezone and keyboard selection with an application crash notification for gparted. The same error as above is produced running gparted from the command line with sudo. "Assertion (head_size <= 63) at ../../../libparted/labels/dos.c:659 in function probe_partition_for_geom() failed."

Phillip Susi (psusi) wrote :

Can you post the output of sudo fdisk -lu on the usb stick in question?

Changed in gparted (Ubuntu):
status: New → Incomplete
Chris Beaven (smileychris) wrote :

Here's the fdisk -lu output for my USB stick:

--------------
Disk /dev/sdb: 4009 MB, 4009754624 bytes
23 heads, 23 sectors/track, 14804 cylinders, total 7831552 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
Disk identifier: 0x00086e2a

   Device Boot Start End Blocks Id System
/dev/sdb1 * 8064 7831551 3911744 c W95 FAT32 (LBA)
--------------

Changed in gparted (Ubuntu):
status: Incomplete → New
Phillip Susi (psusi) wrote :

Chris, did you post in the wrong bug? This is the first time you have posted here so I'm not sure why you did.

Curtis Gedak (gedakc) wrote :

Chris, it appears that you are able to create the crash problem using parted alone (no gparted).

Next we should try to narrow the problem down to whether the problem is related to patches made to parted 2.2 in Ubuntu 10.04, or an unmodified version of parted 2.2.

Would you be able to do one of the following?

Either 1) Download the parted 2.2 source code, compile, and re-test

Or 2) Download GParted-Live-0.5.2-1 from the stable branch and re-test.

GParted-Live-0.5.2-1 (not a newer release) contains unpatched parted-2.2 code and can be found on the GParted web site under Oldfiles section of the stable branch.
http://sourceforge.net/projects/gparted/files/gparted-live-stable/

Chris Beaven (smileychris) wrote :

Phillip:
Hi, I opened a ticket about the same issue as this one, and only found this after the fact, so I duplicated mine and took my discussion here.

Curtis:
Downloaded and /.configure'd parted source (ftp://ftp.gnu.org/gnu/parted/parted-2.2.tar.gz), going through the dependency hoops.

Still erroring, so it seems it's a parted error (attaching the backtrace)

Curtis Gedak (gedakc) wrote :

Chris, thanks for confirming the problem also exists in unpatched parted-2.2.

The next step would be to raise this problem to the attention of the parted developers. You can do this by sending an email to the bug-parted mailing list (<email address hidden>) with the bug details, logs, etc.

The parted web site also has a bug tracker, but this does not appear to in active use by the parted developers.
http://www.gnu.org/software/parted/index.shtml

RickySmart (ricchartz) wrote :

Hi!

I have the same problem, but i have it on my already installed system Ubuntu 10.04. I can't use fdisk anymore.

This is the log of fdisk:

_________
ricky@smart:~$ sudo fdisk -l

Disk /dev/sda: 8 GB, 8068999680 bytes
255 heads, 63 sectors/track, 981 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 981 7879851 83 Linux
Warning: Partition 1 does not end on cylinder boundary.
Backtrace tiene 14 llamadas en espera: [Backtrace has 14 calls remaining:]
  14: /lib/libparted.so.0(ped_assert+0x2a) [0xa4df0a]
  13: /lib/libparted.so.0(+0x42507) [0xa85507]
  12: /lib/libparted.so.0(+0x43317) [0xa86317]
  11: /lib/libparted.so.0(+0x4460c) [0xa8760c]
  10: /lib/libparted.so.0(+0xf7b1) [0xa527b1]
  9: /lib/libparted.so.0(ped_disk_add_partition+0x262) [0xa56032]
  8: /lib/libparted.so.0(+0x45fa3) [0xa88fa3]
  7: /lib/libparted.so.0(+0x4619f) [0xa8919f]
  6: /lib/libparted.so.0(ped_disk_new+0x75) [0xa56e15]
  5: fdisk() [0x805094c]
  4: fdisk() [0x8050a30]
  3: fdisk() [0x804b1ab]
  2: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xc3ebd6]
  1: fdisk() [0x804b0f1]
Se ha detectado un error en GNU Parted. Vaya al sitio web de parted http://www.gnu.org/software/parted/parted.html para obtener información sobre qué puede ser útil enviar. Envíe un informe por correo a <email address hidden> que contenga al menos la versión (2.2) y el siguiente mensaje: La aserción (head_size <= 63) en ../../../libparted/labels/dos.c:659 en la función probe_partition_for_geom() ha fallado.

# An error was detected on GNU Parted. [...] The assertion(head_size <= 63) en ../../../libparted/labels/dos.c:659 in the function probe_partition_for_geom() failed

Cancelado
______________

ProblemType: Bug
Architecture: Intel Atom
Date: tue Jan 13 11:11:16 2011
DistroRelease: Ubuntu 10.04
Package: gparted 0.5.1-1ubuntu3
ProcEnviron:
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-16.25-generic
SourcePackage: gparted
Uname: Linux 2.6.32-16-generic x86

Curtis Gedak (gedakc) wrote :

The log in comment #12 indicates libparted is being used. The libparted library is part of the parted project.

Perhaps you installed a version of fdisk that uses libparted (e.g., gnu-fdisk)?

If so you might wish to run the version from utils-linux-ng (now utils-linux) instead.

Caysho (caysho) wrote :

I was getting this problem when installing 10.10 onto an ASUS K52F notebook from a USB stick prepared by UNetbootin on Windows XP SP3.
I could run the "Live CD", and gparted would segfault when run from the command line.
The GUI install just hangs.

I did get it working after I did the install from a CD - that was fine.

Maybe the partitioner is getting confused and is trying to get a read/write lock on the device the installer is booted from (USB stick) ?
The CD I used was a CDRW, but I expect it booted as read only.
In the BIOS, I had to set both the USB stick as the first in the boot order and in the drive order to get the USB stick to boot.

TheBeest (thebeest) wrote :

Caysho, although it shouldnt be the case I think this is partly an issue with the way UNetbootin deals with the Ubuntu ISO as I tested this with a USB stick made from the Ubuntu USB Startup Disk Creator. I know you have already installed it now but if you have a chance could you test with a disk made from within ubuntu?
Cheers!

Caysho (caysho) wrote :

I should be able to try it again this week.

However, I just tried running gparted with an Imation 4 GB stick straight from the packaging.
lsusb shows:
Bus 001 Device 008: ID 0718:044e Imation Corp.

I was going to put dban on it, and I get a crash similar to the one in the bug description:

======================
libparted : 2.2
======================
Backtrace has 16 calls on stack:
  16: /lib/libparted.so.0(ped_assert+0x2a) [0x87af0a]
  15: /lib/libparted.so.0(+0x42507) [0x8b2507]
  14: /lib/libparted.so.0(+0x43317) [0x8b3317]
  13: /lib/libparted.so.0(+0x4460c) [0x8b460c]
  12: /lib/libparted.so.0(+0xf7b1) [0x87f7b1]
  11: /lib/libparted.so.0(ped_disk_add_partition+0x262) [0x883032]
  10: /lib/libparted.so.0(+0x45fa3) [0x8b5fa3]
  9: /lib/libparted.so.0(+0x4619f) [0x8b619f]
  8: /lib/libparted.so.0(ped_disk_new+0x75) [0x883e15]
  7: /usr/sbin/gpartedbin() [0x80901e6]
  6: /usr/sbin/gpartedbin() [0x809fc9b]
  5: /usr/sbin/gpartedbin() [0x80c0532]
  4: /usr/lib/libglibmm-2.4.so.1(+0x30eb2) [0x4b3eb2]
  3: /lib/libglib-2.0.so.0(+0x65def) [0x61cdef]
  2: /lib/tls/i686/cmov/libpthread.so.0(+0x596e) [0x6a596e]
  1: /lib/tls/i686/cmov/libc.so.6(clone+0x5e) [0x106aa4e]
Assertion (head_size <= 63) at ../../../libparted/labels/dos.c:659 in function probe_partition_for_geom() failed.

This happened:
1. when the stick was connected before gparted was run.
2. gparted was run, then the stick inserted and the drives refreshed.

I am making an image of the stick with dd, and I can upload it if it would be useful - suggestions for locations welcome.

Caysho (caysho) wrote :

I used the USB start up disk creator in the installed Ubuntu 10.10 to create an installation USB stick.
This booted and started the partitioner without errors.

Curtis Gedak (gedakc) wrote :

Based on your report, it appears that the usb device has an invalid partition table.

A work around is to copy your data to another device, write a new partition table to the usb device, and then restore your data back to the usb device.

A similar bug has been reported:

Verbatim USB stick crashes gParted
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/710696

Phillip Susi (psusi) wrote :

Who was that to Curtis?

I have been trying to dup similar reports against this one to collect them all together. It seems plenty of people are having this issue and upstream can not figure out why. If anyone is still having it and has not managed to reformat the affected drive to fix it, please speak now so we can try to get a sample of the partition table and figure out what is wrong. The distinguishing characteristic of this is the line:

Assertion (head_size <= 63) at ../../../libparted/labels/dos.c:659 in function probe_partition_for_geom() failed.

Curtis Gedak (gedakc) wrote :

Hi Phillip,

Other bug posts that are related to this bug post are as follows:

gparted just crash when my thumbdrive (Kingston DataTraveler G3 4Gb) is pluged in.
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/657784

Gparted close when mount usb device
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/695341

Verbatim USB stick crashes gParted
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/710696

There have also been at least two reports of this problem upstream in the bug-parted mailing lists:

Re: Bug report
http://lists.gnu.org/archive/html/bug-parted/2011-02/msg00002.html

Verbatim USB drive crashes libparted
http://lists.gnu.org/archive/html/bug-parted/2011-02/msg00000.html

In each of the above two cases, I manually went through the calculations for head_size (the number of sectors that would pass under a single disk head in a single rotation of the disk), and in each case the value was greater than 63. From the MBR specification, the range for sectors is from 1 to 63.
Master Boot Record
http://en.wikipedia.org/wiki/Master_boot_record

There is also a post in the parted-devel mailing list regarding this problem:

> 63 heads. Why does this keep coming up?
http://lists.alioth.debian.org/pipermail/parted-devel/2011-February/003796.html

I think it would be preferable if the libparted library were better able to indicate this problem to the user, as opposed to throwing a stack trace.

Phillip Susi (psusi) wrote :

CHS is a useless fiction anyhow. It looks like this function was meant to simply print an error and then carry on if it can not guess the bios geometry, but PED_ASSERT() ignores its second argument and never returns. I have patched the code to use if( foo ) return 0; rather than PED_ASSERT() and this should solve the problem.

Phillip Susi (psusi) wrote :

I just tested it using the MBR from bug #710696 and it works now.

Changed in parted (Ubuntu):
status: New → In Progress
assignee: nobody → Phillip Susi (psusi)
Derek (bugs-m8y) wrote :

Thanks to:
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/558431/comments/12

(bug was marked duplicate)

I was assisting someone w/ a remote flash install of ubuntu.
4003 MB, 4003463168 bytes 84 heads, 20 sectors/track, 4654 cylinders Units = cylinders
of 1680 * 512 = 860160 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size
(minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xc3072e18
Device Boot Start End Blocks Id System
/dev/sdd1 * 5 4655 3905600 c W95 FAT32 (LBA)

Deleting the partition and recreating it starting at 1 fixed the error.

Curtis Gedak (gedakc) wrote :

My testing results of Phillip's patch can be found in the parted-devel mailing list:
[parted-devel] > 63 heads. Why does this keep coming up?
http://lists.alioth.debian.org/pipermail/parted-devel/2011-February/003806.html

Derek,
As you point out in comment #23, a work-around to this problem is to start with a new partition table. Of course if there was data on the disk device, one would want to back this up before writing a new partition table.

Maverick AMD64 Desktop CD's gparted crashes during loading due to not liking LVM partitions. Tried running an update (on the CD; I have much RAM) and it still crashes!

tags: added: maverick
Phillip Susi (psusi) wrote :

Crashes how thomas? With the message; Assertion (head_size <= 63)? What makes you say it has anything to do with LVM? If it does, then it is unrelated to this bug.

Curtis Gedak (gedakc) wrote :

Phillip, would it be possible to update the title of this bug to something link "GParted crashes with Assertion (head_size <= 63)"?

If so, that might help others with filing bug reports in the proper area.

Phillip Susi (psusi) wrote :

Good idea. You know Curtis, you could join the bugsquad team and do that sort of thing yourself ;)

summary: - Cannot use gparted
+ GParted crashes with Assertion (head_size <= 63)
Curtis Gedak (gedakc) wrote :

Thanks for the tip Phillip. I have added your suggestion to my todo list to learn more about the bugsquad team. :-)

Colin Watson (cjwatson) wrote :

Regarding PED_ASSERT, it may be useful to refer to http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=562e0007840f06f475b43bb81ffe81b238b627b5 (which I think supports your change).

Phillip Susi (psusi) wrote :

Yes, there was some discussion on the mailing list and the conclusion seems to be that my patch is good, and that all remaining users of PED_ASSERT need reviewed and the second argument completely dropped, and any other users that actually expect the second argument to be used need rewritten similarly to what I did with this patch.

Phillip Susi (psusi) wrote :

Closing gparted task since the bug is in parted.

Changed in gparted (Ubuntu):
status: New → Invalid
Phillip Susi (psusi) on 2011-03-19
Changed in parted (Ubuntu):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package parted - 2.3-5ubuntu4

---------------
parted (2.3-5ubuntu4) natty; urgency=low

  * Add fix-head-size-assertion.patch:
    Fix probe_partition_for_geom() to fail gracefully rather
    than abort with PED_ASSERT(). (LP: #545911)
  * Add dm_p_separator.patch: Device mapper type should not
    automatically mean add 'p' before the partition number.
    Fall back to adding it only if the previous character is
    a digit. This complies with kpartx behavior and linux
    behavior "since the dawn of time".
  * Refresh dasd-sync.patch, dmraid.patch, tiny-disk-constraint.patch,
    udevadm-settle.patch.
  * debian/control: Breaks versions of dmraid not
    patched to follow the same 'p' behavior.
 -- Phillip Susi <email address hidden> Sat, 12 Feb 2011 16:37:05 -0500

Changed in parted (Ubuntu):
status: In Progress → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gparted - 0.11.0-1

---------------
gparted (0.11.0-1) unstable; urgency=low

  * Merge from 0.8.1-1ubuntu5: Run dh_translations during build,
    if available.
  * New upstream release

    GParted 0.11.0 (2011-12-13)

    Key changes include:
    - Display ext2/3/4, ntfs, and btrfs unicode volume labels properly
    - Add labelling of btrfs file systems
    - Enable XFS copy to new smaller partition

    Bug Fixes
    - Display ext2/3/4 unicode volume labels properly (#662537)
    - Display ntfs unicode volume labels properly
      LP: #614994
    - Fix FAT16/32 label displayed as uppercase (#625337)
    - Add labelling of btrfs file systems (#663207)
      Thanks to Mike Fleetwood for small patch
      Requires btrfs-tools package yet-to-be-released (> Oct 25, 2011)
    - Fix btrfs volume label reading (#663590)
      Thanks to Mike Fleetwood for small patch
    - Enable XFS copy to new smaller partition (#663806)
      Thanks to Stephen Kirkby for small reverse umount order patch
    - Use newer btrfs multi-tool control command first (#663884)
      Thanks to Mike Fleetwood for this patch
    - Avoid redundant file system maximize actions (#663980)

 -- Phillip Susi <email address hidden> Mon, 23 Jan 2012 18:39:56 -0500

Changed in gparted (Ubuntu):
status: Invalid → Fix Released
loue crow (kyrios-fire) on 2012-06-06
Changed in gparted (Ubuntu):
assignee: nobody → loue crow (kyrios-fire)
affects: parted (Ubuntu) → gparted
Phillip Susi (psusi) wrote :

Please don't fiddle with buttons you don't understand.

affects: gparted → parted (Ubuntu)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers