palimpsest crash with libgdu:ERROR:gdu-pool.c:2369:device_recurse: assertion failed: (depth < 100)

Bug #571038 reported by BuM
256
This bug affects 46 people
Affects Status Importance Assigned to Milestone
GNOME Disks
Expired
Medium
udisks
Won't Fix
Medium
gnome-disk-utility (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Binary package hint: gnome-disk-utility

gnome-disk-utility 2.30.1-1

palimpsest
**
libgdu:ERROR:gdu-pool.c:2369:device_recurse: assertion failed: (depth < 100)
Aborted

Good stack trace from a duplicate: https://launchpadlibrarian.net/87890577/Stacktrace.txt

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: gnome-disk-utility 2.30.1-1
ProcVersionSignature: Ubuntu 2.6.32-21.32-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-generic i686
NonfreeKernelModules: nvidia ath_hal
Architecture: i386
CheckboxSubmission: b6d3f9688481829aa18d194ae2c428e7
CheckboxSystem: 1cdd12c3facc79381f02e281767fe3cc
Date: Wed Apr 28 03:03:14 2010
ProcEnviron:
 LANG=pl_PL.utf8
 SHELL=/bin/bash
SourcePackage: gnome-disk-utility

Revision history for this message
BuM (bumaw) wrote :
Changed in gnome-disk-utility (Ubuntu):
status: New → Confirmed
Revision history for this message
Pacho Ramos (pacho) wrote :
Revision history for this message
Pacho Ramos (pacho) wrote :

This also affected to a few people at Gentoo:
http://bugs.gentoo.org/show_bug.cgi?id=321971

But we still have no idea about where is the problem :-(

Revision history for this message
Nandox7 (nandox7) wrote :

Can you get some details from the devices and partitions that you have on your system?

Something like:
$sudo fdisk -l

Revision history for this message
Pacho Ramos (pacho) wrote :

This is from affected user in gentoo:

# fdisk -l
omitting empty partition (5)

Disco /dev/sda: 150.0 GB, 150039945216 byte

255 testine, 63 settori/tracce, 18241 cilindri, totale 293046768 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x104f104e

Dispositivo Boot Start End Blocks Id System
/dev/sda1 63 2104514 1052226 6 FAT16
/dev/sda2 2104515 149565149 73730317+ c W95 FAT32 (LBA)
/dev/sda3 149565150 159814619 5124735 c W95 FAT32 (LBA)
/dev/sda4 159814620 293046767 66616074 f W95 Esteso (LBA)
/dev/sda5 159814683 164023649 2104483+ b W95 FAT32
/dev/sda6 164023713 293046767 64511527+ b W95 FAT32

Disco /dev/sdb: 320.1 GB, 320072933376 byte

255 testine, 63 settori/tracce, 38913 cilindri, totale 625142448 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0xa8ec58b5

Dispositivo Boot Start End Blocks Id System
/dev/sdb1 * 63 625137344 312568641 7 HPFS/NTFS

Revision history for this message
Nandox7 (nandox7) wrote :

The error comes from here:
gdu-pool.c (libgdu0)
--
(...)
static void
device_recurse (GduPool *pool, GduDevice *device, GList **ret, guint depth)
{
        gboolean insert_after;

        /* cycle "detection" */
        g_assert (depth < 100); <--- HERE

        insert_after = FALSE;

        if (gdu_device_is_partition (device)) {
                const gchar *partition_table_object_path;
                GduDevice *partition_table;
(...)
---

It goes over the partition tables and starts to parse them, increments 'depth' on several occasions:
---
(...)
                /* we want the partition table to come before any partition */
                if (partition_table != NULL)
                        device_recurse (pool, partition_table, ret, depth + 1);
(...)
or
(...)
                       /* logical MSDOS partition, ensure that the extended partition comes before us */
                        extended_partition = find_extended_partition (pool, partition_table_object_path);
                        if (extended_partition != NULL) {
                                device_recurse (pool, extended_partition, ret, depth + 1);
                        }

(...)
---

So it seem that somehow while reading and composing the tree it exceeds the 100 levels.
I'd say the next steps now would be to determine what device is triggering it and determine why.

But again it's the first time I'm looking into this code so I may be saying a big mistake. :)

Revision history for this message
Mike Bell (slickvguy) wrote :

I'm now getting this error as well. nandox7, I think you've got it pretty much nailed. The code is having trouble reading the partition table or EBR or ? Not-too-coincidentally, yesterday I installed Paragon B&R 10 FE on my Win7 partition, and was testing it by backing up and restoring my Win7 partition. Grub2 is working fine - I can boot into Ubuntu Lucid and Win7 w/o problems. But my guess is that the Paragon s/w changed something that palimpsest can no longer read/calc properly. Hope that might give you guys a clue.

Revision history for this message
Mike Bell (slickvguy) wrote :

Update: Fixed my partitions and I'm no longer getting an error running palimpsest. I imagine that gparted and other disk-oriented programs have various ways of figuring out the partition structure even w/ slightly messed-up partition tables, whereas palimpsest's method of enumerating the partitions just couldn't handle a non-standard (though non-corrupted) situation. GL.

Revision history for this message
Nandox7 (nandox7) wrote :

I seem to overlooked a detail above.

From Pacho Ramos partition list:

--
# fdisk -l
omitting empty partition (5) <--- HERE

(...)
---

So even fdisk is complaning about error in the partitions.
Combined with your example it seems to further confirm that an error in the partition tables causes this.

Maybe using sfdisk instead to get the partitions definitions (sfdisk -d /dev/device > part.list), as fdisk seems to fails
to get them.

Revision history for this message
Pacho Ramos (pacho) wrote :

This is the output from affected user:
sfdisk -d /dev/sda:

# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 2104452, Id= 6
/dev/sda2 : start= 2104515, size=147460635, Id= c
/dev/sda3 : start=149565150, size= 10249470, Id= c
/dev/sda4 : start=159814620, size=133232148, Id= f
/dev/sda5 : start=159814683, size= 4208967, Id= b
/dev/sda6 : start=164023713, size=129023055, Id= b

Revision history for this message
BuM (bumaw) wrote :

sfdisk -d /dev/sda:
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size=144938367, Id= 7, bootable
/dev/sda2 : start=144938430, size=245762370, Id= f
/dev/sda3 : start=147043008, size= 40965687, Id=83
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start=144938556, size= 2104389, Id=82
/dev/sda6 : start=188008758, size=202692042, Id= 7

Revision history for this message
Florian Lederer (flederohr) wrote :

sfdisk -d:
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 2048, size= 190464, Id=83, bootable
/dev/sda2 : start= 195313, size=321475855, Id= f
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start= 195314, size=195117187, Id=83
/dev/sda6 : start=195318333, size=117178047, Id=83
/dev/sda7 : start=312498176, size= 9172992, Id=82

# partition table of /dev/sdb
unit: sectors

/dev/sdb1 : start= 2048, size= 204800, Id= 7, bootable
/dev/sdb2 : start= 208845, size=125829120, Id= 7
/dev/sdb3 : start=126038016, size=3780988928, Id= f
/dev/sdb4 : start= 0, size= 0, Id= 0
/dev/sdb5 : start=126041459, size=629145600, Id= 7
/dev/sdb6 : start=755188915, size=629145600, Id= 7
/dev/sdb7 : start=1384336371, size=629145600, Id= 7

Revision history for this message
Florian Lederer (flederohr) wrote :

udisks --dump | awk '{if($1=="type:" || $1=="Showing") print}':

Showing information for /org/freedesktop/UDisks/devices/sda
  type:
Showing information for /org/freedesktop/UDisks/devices/sda1
  type: ext2
    type: 0x83
Showing information for /org/freedesktop/UDisks/devices/sda2
  type:
    type: 0x0f
Showing information for /org/freedesktop/UDisks/devices/sda5
  type: ext4
    type: 0x83
Showing information for /org/freedesktop/UDisks/devices/sda6
  type: ext4
    type: 0x83
Showing information for /org/freedesktop/UDisks/devices/sda7
  type: swap
    type: 0x82
Showing information for /org/freedesktop/UDisks/devices/sdb
  type:
Showing information for /org/freedesktop/UDisks/devices/sdb1
  type: ntfs
    type: 0x07
Showing information for /org/freedesktop/UDisks/devices/sdb2
  type: ntfs
    type: 0x07
Showing information for /org/freedesktop/UDisks/devices/sdb3
  type:
    type: 0x0f
Showing information for /org/freedesktop/UDisks/devices/sdb5
  type:
    type: 0x05
Showing information for /org/freedesktop/UDisks/devices/sdb6
  type: ntfs
    type:
Showing information for /org/freedesktop/UDisks/devices/sdb7
  type: ntfs
    type:

The type of sdb5 should have been also ntfs!

Revision history for this message
yellowhat (yellowhat46) wrote :

Hi, I am the gentoo user that have this problem. This is my situation:
I have 3 hard disk: WD 320 GB 2.5 Backup (connected directly on mainboard), WD
Raptor 150GB Gentoo (connected through an Enermax Mobil Rack), Seagate 320GB
3.5 Win7(connected through an Enermax Mobil Rack).
Now for high temperature I use only WDs because on Seagate I have only Windows
7.
WD raptor has always been connect to a rack (the upper one), but I have tried
to
connect WD Raptor to the other one and automount works. So I decided to
return to previous configuration and gives me no automount and same palimpsest
error.
Both rack are connect to the red Sata ports, while HDD Backup and DVD-RW to the
black ones.

Thanks

summary: - palimpsest
+ palimpsest crash with libgdu:ERROR:gdu-pool.c:2369:device_recurse:
+ assertion failed: (depth < 100)
Changed in gnome-disk-utility (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in gnome-disk-utility:
importance: Unknown → Medium
status: Unknown → New
Changed in gnome-disk-utility (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
François Gez (palmwinep) wrote :

Same error here.
My fdik -l and gparted are working fine. However I get:

zebulon@ordrealphabetix:/etc$ sudo palimpsest
**
libgdu:ERROR:gdu-pool.c:2369:device_recurse: assertion failed: (depth < 100)
Aborted

Nothing is showing up on my system's disk mounter applet apart of the bootable (root) filesystem and the floppy disk.

Are missing the cdrom, a usb key or a second disk.
I have being using 8.04 for years without much trouble and already missing it :/

Gary M (garym)
tags: added: maverick
Revision history for this message
Adam Niedling (krychek) wrote :

I'm having the same problem with Natty-beta. When I start either palimpsest, update-notifier or gdu-notification-daemon I'm getting the same error message:

krychek@hostname:~$ /usr/lib/gnome-disk-utility/gdu-notification-daemon
**
libgdu:ERROR:gdu-pool.c:2369:device_recurse: assertion failed: (depth < 100)
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
/home/krychek/2889: No such file or directory.
No stack.

It might has something to do with another bug on my system. Gparted can't seem to find my partitions. When started it says "Can't have overlapping partitions." and in the GUI it only shows unallocated disk space.
I must be having some problem with my partition table..

Revision history for this message
Adam Niedling (krychek) wrote :

After some investigation I don't see any problem with my partition table. Or maybe it's a problem that the partition are not in the correct order?

fdisk -l
omitting empty partition (5)

Disk /dev/sda: 300.1 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x20a520a5

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 1785 14337981 7 HPFS/NTFS <- Windows "root" partition
/dev/sda2 1786 36482 278703652+ f W95 Ext'd (LBA) <- Extended partition
/dev/sda3 3856 36482 262076377+ 7 HPFS/NTFS <- Large NTFS partition for stuff
/dev/sda5 1786 1909 995967 82 Linux swap / Solaris <- SWAP
/dev/sda6 1910 3855 15631213+ 83 Linux <- Linux root partition

cfdisk:
Partition Table for /dev/sda

         ---Starting---- ----Ending----- Start Number of
 # Flags Head Sect Cyl ID Head Sect Cyl Sector Sectors
-- ----- ---- ---- ----- ---- ---- ---- ----- ----------- -----------
 1 0x80 1 1 0 0x07 254 63 1784 63 28675962
 2 0x00 0 1 1785 0x0F 254 63 36481 28676025 557407305
 3 0x00 0 1 3855 0x07 254 63 36481 61930575 524152755
 4 0x00 0 0 0 0x00 0 0 0 0 0
 5 0x00 2 1 1785 0x82 254 63 1908 125 1991934
 6 0x00 1 1 1909 0x83 254 63 3854 63 31262427

Gary M (garym)
tags: added: natty
Revision history for this message
Adam Niedling (krychek) wrote :

I think the problem here is that the partitions are not in the same order as they are physically located on the disk. This is also causing the parted bug (bug #103794). It would be much better if gparted could fix this problem instead of just showing unallocated disk space. I guess there is no easy way to fix my partition table.

Revision history for this message
Ross Patterson (rossp) wrote :

This affects only one of my two Ubuntu Natty systems. The same removable drive automounts on one but not the other. With no removable drive, the broken one gives the following:

    $ /usr/lib/gvfs/gvfs-gdu-volume-monitor
    **
    libgdu:ERROR:gdu-pool.c:2369:device_recurse: assertion failed: (depth < 100)
    Aborted

While on the working one the command starts up just fine.

The broken system has been having automount problems since at least lucid, but until just recently, I could get automount to work by logging out and logging back in. IOW, automount was broken on the first login after boot, but subsequent logins worked. Now it never works and I have to use pmount to mount removable drives.

Attached is the output of:

    $ strace /usr/lib/gvfs/gvfs-gdu-volume-monitor >/tmp/gvfs-gdu-volume-monitor.strace 2>&1

Revision history for this message
Brian Smith (toolman59) wrote :

Mike Bell wrote:

"Update: Fixed my partitions and I'm no longer getting an error running palimpsest."

I would be interested know how the partitions were fixed.

toolman59

Revision history for this message
Somogyi Ádám (denadarka) wrote :

Hi, I was getting this same error, since I've installed natty.
Automounting was not working with partitions, CDROMs and USB keys.

My partition table looked OK to me, only fdisk complained something about an empty partition being omitted.

I've tried fixparts from the gptfdisk utilities, and it helped.

So, here is my partition table before fixparts, in sfdisk -d format:

# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 49158837, Id= 7, bootable
/dev/sda2 : start= 49158900, size=1201099725, Id= f
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start= 49158963, size=251915202, Id= 7
/dev/sda6 : start=301074228, size= 16000677, Id=83
/dev/sda7 : start=317074968, size= 65545137, Id= 7
/dev/sda8 : start=382620168, size=867638457, Id= 7

and after:

# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 49158837, Id= 7, bootable
/dev/sda2 : start= 49158962, size=1201099663, Id= f
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start= 49158963, size=251915202, Id= 7
/dev/sda6 : start=301074228, size= 16000677, Id=83
/dev/sda7 : start=317074968, size= 65545137, Id= 7
/dev/sda8 : start=382620168, size=867638457, Id= 7

I hope that's proves to be useful!

Revision history for this message
qweasdzxc (qweqweqweqweqwe-deactivatedaccount) wrote :

GRUB re installation (caused by something else) solved the problem. Everything, especially automount and palimpsest, works fine now.

Revision history for this message
Ross Patterson (rossp) wrote :

Regarding #22, "sudo grub-install /dev/sda" did not fix my problem, still seeing it.

Revision history for this message
Ross Patterson (rossp) wrote :

Regarding #21, I just did fixparts repair on one of the disks I have and I'm still getting the palimpsest error and it still won't auto mount. Also remember that I at least can automount the same disk on a different ubuntu natty system just fine. So it seems likely that there is some sort of driver/kernel/hardware bug or some configuration problem that has crept in for some sytems. How do we dig deeper here? I'm tired of using pmount. :-)

Revision history for this message
Adam Niedling (krychek) wrote :

I followed Somogyi Ádám's solution and it did work. However I had to reinstall grub(!) and I'm having all sorts of strange error messages:

sudo gparted
Error informing the kernel about modifications to partition /dev/sda2 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/sda2 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Failed to add partition 2 (Device or resource busy)

palimpset
(palimpsest:2589): libgdu-WARNING **: Partition /org/freedesktop/UDisks/devices/sda5 is a logical partition but no extended partition exists

sudo sfdisk -d
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 28675962, Id= 7, bootable
/dev/sda2 : start= 28676150, size= 33254425, Id= f
/dev/sda3 : start= 61930575, size=524152755, Id= 7
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start= 28676151, size= 1991934, Id=82
/dev/sda6 : start= 30668148, size= 31262427, Id=83

Revision history for this message
Ross Patterson (rossp) wrote :

One more data point, I've confirmed that this problem occurrs on the same machine when booting from the natty 11.04 cd both i386 and amd64, while it never happens with the same external drive on another machine running natty.

Revision history for this message
Mikhail Titov (mtitov) wrote :

Here is how it develops from looking from eclipse. Don't have time to investigate more for now, but I hope it can be useful.

Revision history for this message
Mikhail Titov (mtitov) wrote :

Regarding #13, I feel like this is the root of the evil. In my case it also reports type 0x05 for my root linux partition on /dev/sda5 . This in turn is interpreted incorrectly by find_extended_partition() in gdu-pool.c that thinks it is an extended partition and goes into infinite recursion.

Revision history for this message
Mikhail Titov (mtitov) wrote :

sfdisk shows correct information. However when I look into EBR it doesn't make any sense to me.

$ dd if=/dev/sda2 count=1 of=ebr
$ hexdump ebr
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
00001c0 feff 5705 fec8 003e 0000 a2ea 052f 0000
00001d0 0000 0000 0000 0000 0000 0000 0000 0000
*
00001f0 0000 0000 0000 0000 0000 0000 0000 aa55
0000200

Why there is no link to next EBR?? 2nd entry is full of zeros that means an end of a linked list. And indeed it says type 0x05 that is picked up by udev, etc...

Revision history for this message
Mikhail Titov (mtitov) wrote :

I conclude that there is a problem (?) with udev that lacks support for nested partition http://www.ata-atapi.com/hiwtab.html#T4 and probably only linked extended partitions are properly supported. That explains that weirdness I saw in my ebr, i.e. no link to another ebr.

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49623
udevadm info --export-db

Probably some non-free partitioning tools produce nested though valid partition scheme involving nested partitions. That is there is a reference for extended partition of type 0x0f in MBR that refers to another partition (/dev/sda2 in my case) that has only single record in EBR of type 0x05 and all other extended partition are within that and are not linked from very first EBR.

This leads to incorrect report of valid partitions as if they have partition type 0x05. This breaks some things in gnome environment in particular like https://bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/571038 .

I'm running udisks 1.0.2, gvfs 1.8.0, no libatasmart installed

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49624
/etc/fstab

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49625
udisks dump

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49626
cat /proc/self/mountinfo

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49627
sfdisk -l

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49636
some changes

I'm not familiar with the code well and this patch is far from being final. It is just to demonstrate the issue. It helps to discover some other partitions. Also it reports correct partition type for my /dev/sda5 i.e. 0x83 instead of 0x05 .

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49637
./udisks-part-id /dev/sda5 > log 2>&1

This is what I'm getting after that patch. Someone should double check everything as I'm not that big expert in EBR.

Revision history for this message
Mikhail Titov (mtitov) wrote :

Here is the link on bug I submitted with udisks https://bugs.freedesktop.org/show_bug.cgi?id=39603

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49642
/lib/udev/udisks-part-id /dev/sda5 > /tmp/udisks_part_id_original.txt 2>&1

This is for comparison with previous one. You can see that original report 0x05 for my root on /dev/sda5 and this make libgdu to confuse a lot.

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49644
hexdump enabled ./probers/udisks-part-id /dev/sda5 > /tmp/udisks_hexdump.txt 2>&1

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Comment on attachment 49644
hexdump enabled ./probers/udisks-part-id /dev/sda5 > /tmp/udisks_hexdump.txt 2>&1

While second hexdump looks like mbr, in fact it is not. Also note that consequent ebr points to another ebr using partition type 0x05 again. That is crazy!

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49646
slightly rewritten patch but still not final

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49647
./probers/udisks-part-id /dev/sda6 > /tmp/udisks_part_id_sda6.txt 2>&1

This is an attempt to get info for /dev/sda6 . part-id failed to find /dev/sda6 at 142856695296 , however patched parser found yet another extended partition 0x05 at 142856694784 just one sector (512 bytes) ahead.

mlt@nb:~/workspace/udisks/src$ fdisk -lu
omitting empty partition (5)

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0x046a411b

   Device Boot Start End Blocks Id System
/dev/sda1 * 63 192008879 96004408+ 7 HPFS/NTFS
/dev/sda2 192008880 312581807 60286464 f W95 Ext'd (LBA)
/dev/sda5 192008943 279016919 43503988+ 83 Linux
/dev/sda6 279016983 306279224 13631121 7 HPFS/NTFS
/dev/sda7 306290136 312581807 3145836 82 Linux swap / Solaris

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

(In reply to comment #11)
> Created an attachment (id=49647) [details]
> ./probers/udisks-part-id /dev/sda6 > /tmp/udisks_part_id_sda6.txt 2>&1
>
> This is an attempt to get info for /dev/sda6 . part-id failed to find /dev/sda6
> at 142856695296 , however patched parser found yet another extended partition
> 0x05 at 142856694784 just one sector (512 bytes) ahead.

Note pstart = 512 before the last hexdump when it failed to find signature! Those pstart must be relative to that nested extended partition.

Revision history for this message
In , Mikhail Titov (mtitov) wrote :

Created attachment 49650
And that is all that was missing :-)

In some cases EBR has only a single non-zero entry that should be interpreted as a link.

Revision history for this message
Mikhail Titov (mtitov) wrote :

It would be nice if ubuntu could release patched package first as crashing update-notifier pissed me off completely.

Revision history for this message
Mikhail Titov (mtitov) wrote :

Just to confirm that this patch solved an issue for me. I got source with apt-get, patched it, and installed it. palimpsest starts just fine.

tags: added: patch
Revision history for this message
Paul R. Potts (cful) wrote :

Hello,

Just created an account here so I could comment. I just started seeing this bug.

Don't know if it will still help, but the output of sudo sfdisk -d

Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 2048, size= 2457600, Id= 7, bootable
/dev/sda2 : start= 2459648, size=226342912, Id= 7
/dev/sda3 : start=466890752, size= 21504368, Id= 7
/dev/sda4 : start=228802560, size=238088192, Id= 5
/dev/sda5 : start=228804608, size=233887744, Id=83
/dev/sda6 : start=462696448, size= 4192256, Id=82

This is a ThinkPad with Windows 7. The partitions as I understand them (as shown by Paragon and gparted) are as follows:

sda1 is NTFS SYSTEM_DRV 1.1 GiB
sda2 is NTFS Windows7_OS 107.9 GiB
then an extended partition with a 111.5 GiB ext4 partition and 1.9 GiB swap
sda3 is Lenovo_Recovery 10.2 GiB

Is the issue that the partitions are numbered out of order as they appear on disk? This seems to be the way the ThinkPad came from the factory, although I have added and modified Linux partitions and I admit I don't fully understand how the partition numbers are generated/stored.

Revision history for this message
Paul R. Potts (cful) wrote :

OK, managed to fix it following this advice:

http://leisurehours.wordpress.com/2010/03/15/partition-table-entries-are-not-in-disk-order-problem/

That required some repair on the GRUB command line, set root and all that, then got my system to boot into Ubuntu and had to do both update-grub and grub install /dev/sda.

I now have this:

Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 2048, size= 2457600, Id= 7, bootable
/dev/sda2 : start= 2459648, size=226342912, Id= 7
/dev/sda3 : start=228802560, size=238088192, Id= 5
/dev/sda4 : start=466890752, size= 21504368, Id= 7
/dev/sda5 : start=228804608, size=233887744, Id=83
/dev/sda6 : start=462696448, size= 4192256, Id=82

gparted now shows this as

/dev/sda1 ntfs SYSTEM_DRV
/dev/sda2 ntfs Windows7_OS
/dev/sda3 extended
  /dev/sda5 ext4 /
  /dev/sda6 linux-swap
/dev/sda4 ntfs Lenovo_Recovery

So it seems like the issue was that sda3 started after sda4 and when these were put back in disk order, it works OK. It appears that gparted will leave the partition table in this state under some circumstances if you add/remove partitions (at one point this drive had four partitions under sda4 until I removed some unused partitions).

Hope this helps.

Revision history for this message
Mikhail Titov (mtitov) wrote :

I feel like the original issue is likely caused by Paragon software that creates so called "empty" partitions. All looks like fdisk can remove those (I didn't know). It would be nice if you tried fdisk -l first as fdisk reports empty partitions.

P.S. "Empty" partition means that extended boot record has only a single record pointing to the next linked partition though usually there should be two records, one pointing to beginning of logical disk and another one should be a link.

Revision history for this message
Ross Patterson (rossp) wrote :

I did a reinstall and it started working again. The odd thing is that I *did* run into this bug when booted from the same CD I did the install from.

Revision history for this message
helmut frahs (email-9ei9n) wrote :

@ Mikhail Titov

I'm having the same issue with an Ubuntu 10.10 installation.
I did use the Paragon software to do the partitioning.
I'm using a Samsung SSD as boot device.

sudo fdisk -l reports the following:

Platte /dev/sda: 128.0 GByte, 128035676160 Byte
255 Köpfe, 63 Sektoren/Spur, 15566 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c1ad5

   Gerät boot. Anfang Ende Blöcke Id System
/dev/sda1 * 1 15567 125033472 83 Linux
omitting empty partition (5)

Platte /dev/sdb: 500.1 GByte, 500107862016 Byte
255 Köpfe, 63 Sektoren/Spur, 60801 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x86c55e9b

   Gerät boot. Anfang Ende Blöcke Id System
/dev/sdb1 3 20477 164465437+ f W95 Erw. (LBA)
/dev/sdb2 20478 59717 315195300 7 HPFS/NTFS
/dev/sdb3 59718 60802 8709781+ 7 HPFS/NTFS
/dev/sdb5 3 20477 164465406 7 HPFS/NTFS

So what can I do now, to get the disk utility and automount working again???

Revision history for this message
Mikhail Titov (mtitov) wrote :

Glad to hear that my guess was correct. I personally applied patch I posted here against udisk source package and rebuilt it. It works for me in 11.10 and I bet it won't be fixed as it is a bug with Paragon's software. You can also try to fix partition table as Paul R. Potts (?) explained above.

Also I'm not certain how to fix it in a future as something changed in udev that I don't follow http://<email address hidden>/msg01100.html .

Revision history for this message
elviseftv (elviseftv) wrote :

Hi. I have a similar problem. But with no overlapping and no bad numbering...
Even gparted shows the whole hard drive in a good condition, with all partitions on it, without any spaces etc..
But my "disk-utility" (palimpsest) doesn't work and shows me this error:

"**
libgdu:ERROR:gdu-pool.c:2369:device_recurse: assertion failed: (depth < 100)
Aborted"

This is my "fdisk -l":

------------------------------------------
omitting empty partition (5)

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x294e294d

   Device Boot Start End Blocks Id System
/dev/sda1 * 63 104872319 52436128+ c W95 FAT32 (LBA)
/dev/sda2 104873984 209750013 52438015 7 HPFS/NTFS/exFAT
/dev/sda3 209750014 279087103 34668545 5 Extended
/dev/sda4 279087104 488397167 104655032 83 Linux
/dev/sda5 209750016 210798591 524288 82 Linux swap / Solaris
/dev/sda6 210800640 279087103 34143232 83 Linux
------------------------------------------

So still something with "omitting empty partition (5)".
Last time I used Paragon software to change sda2 partition filesystem from ext4 into ntfs.
Of course I did some modifications to the Grub2 menu in order to make it load again, after that.
There is no OS on this partition, only data.
Automounting of usb devices doesn't work, but linux finds them - just no automounting.
I checked it with "lsusb".

What can I do now? Is there any idea to fix the problem?

Revision history for this message
Mikhail Titov (mtitov) wrote :

Once again. It is a fault of neither palimpsest nor libgdu but udisks! Just get a source package for udisks, apply my patch attached here, build, and install it. That is it.

It is not the matter of overlapping or wrong numbering, it is an empty record which

a) should not be there in a first place but thanks to Paragon
b) should be recognized properly by udisks (on which libgdu etc rely) like libparted and other do

Revision history for this message
elviseftv (elviseftv) wrote :

Ok, I got it Mikhail, thank You for the info.
I've downloaded the same version of udisks as I have in my ubuntu (it's: 1.0.41).
Then I unpacked the source code and applied with Your patch.
Everything was ok.. Configure - ok. Make - ok. Even make check said everything is ok.
But make install - failed...

This is my terminal report from the terminal:

---
make[4]: Nothing to be done for `install-exec-am'.
test -z "NONE/lib/udev" || /bin/mkdir -p "NONE/lib/udev"
  /bin/bash ../../libtool --mode=install /usr/bin/install -c udisks-part-id udisks-dm-export udisks-probe-ata-smart udisks-probe-sas-expander 'NONE/lib/udev'
libtool: install: `NONE/lib/udev' must be an absolute directory name
libtool: install: Try `libtool --help --mode=install' for more information.
make[4]: *** [install-udevhelperPROGRAMS] Error 1
make[4]: Leaving directory `/home/sivle/Downloads/udisks-1.0.4/src/probers'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/sivle/Downloads/udisks-1.0.4/src/probers'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/sivle/Downloads/udisks-1.0.4/src'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/sivle/Downloads/udisks-1.0.4/src'
make: *** [install-recursive] Error 1
---

So I'm suggesting I can't install it, but do not know why..
When I tried to remove udisks from my system first, aptitude/synaptic wanted to remove all the stuff, I mean the desktop metapackage with session and desktop stuff. So I didn't do it. I thought this could help, but I didn't even check that.
How should I install it?

PS.On the "official" site I found the newest version is 1.9.x (1.9.3), but I don't know if this is a good solution to install a software, which is not in the ubuntu repository, in a proper version..

Revision history for this message
Mikhail Titov (mtitov) wrote :

I'm not sure how you are building the software. Usually you just apt-src it, patch it, and build using corresponding tools for packages. Try not to use vanilla source. Make sure you have all dependencies installed using apt-get build-dep udisks.

Consider https://help.ubuntu.com/community/UpdatingADeb and http://manpages.ubuntu.com/manpages/lucid/man1/apt-src.1p.html .

I might set up ppa and upload patched version for 11.10 tonight (UTC-6) if I won't be too lazy :-)

Revision history for this message
helmut frahs (email-9ei9n) wrote :

Ok - I understand, this is a problem with the paragon software.
But is there a way to fix my system for me as a basic linux user?

I don't know how to patch it etc. unless I have a step-by-step guide.

So please let me know how to fix this or where I can find the how-to.

Thanks - Helmut

Ubuntu 10.10, Dell Inspiron 1720, Samsung 830 128GB SSD

Revision history for this message
elviseftv (elviseftv) wrote :

@Mikhail, to be honest, I've just removed the "ommiting.." text :)
All I did was removing the partition created with Paragon software, and creating it again using gparted.
Now it looks fine, and I think this is ok.
But still having problem with udisks, autmounting.. ehh...
Basically I just downloaded a package direct from the Internet (not using apt), but I didn't think about Yor solution.
Anyway, I'll take a look at all that stuff..

@Helmut, try this: http://linux.about.com/od/ubupck_doc/a/ubupg06t05.htm
The ".diff" files are the patches to the original files located in the source package.
First You download the source package of the progrm You need to be patched. Next, You just copy that "diff" file into directory with the program, and enter command for example: "patch -p0 < file.diff", where "-p0" tells You how much do you want the path to be stripped (the path is indirect and depends on where You have just copied the "diff" file (folders, subfolders etc..), so if the path is: Download/folder/program, then "p0" means no strip, "p1" will give You: folder/program etc..). In Mikhail's diff file there are "a/.." and "b/.." paths, so You need to use "p1" I think - that's what in my case was a good act. The "file.diff" is the patch-file.

I know Im not good at describing some things, especially in english, but maybe You can understand something from that stuff :)

Revision history for this message
Mikhail Titov (mtitov) wrote :

I've uploaded a package to ppa but I don't know how long it would take and if it is okay it was unsigned.
Here is a step-by-step instruction for 11.10. Make sure you are in sudoers list (https://help.ubuntu.com/community/Sudoers)

sudo apt-get install apt-src
apt-src install udisks
cd udisks-1.0.4/
wget -O - https://launchpadlibrarian.net/76141626/git_diff_final.patch | patch -p1
apt-src build --installdebs udisks
echo udisks hold | sudo dpkg --set-selections

Revision history for this message
elviseftv (elviseftv) wrote :

Hmm.. weird... I did everything as You wrote Mikhail, but it still doesn't work..
When I run "apt-get upgrade", I get info line as following:
"The following packages have been kept back: udisks"
I think this isa good info, cause Ive installed source version, but.. why it doesn't work...
In the configurator editor I have "media_automount" and "media_automount_open" checked.
weird...

Even my shortcuts ALT+F1 and ALT+F2 suddenly dissapeared - they are not active anymore..
MAybe that's not associated with the problem but this usb automounting... :(

Revision history for this message
Mikhail Titov (mtitov) wrote :

@elvis_ef
I have no idea what configuration editor you are talking about. Are you sure you've installed built and patched udisks? Were there any rejects? Are you running 11.10 with 1.0.4-1 version of udisks? Are you able to start palimpsest? Try various combinations. With/out usb device connected, original patched udisks (remove hold with "echo udisks install| sudo dpkg --set-selections" to be able to upgrade, and use sudo dpkg -i to install existing deb).

Revision history for this message
elviseftv (elviseftv) wrote :

I'm talking about Configuration Editor (GConf): http://imageshack.us/f/40/screenshotat20120307174.png/ (screenshot).
"Are you sure you've installed built and patched udisks?" - Yes.
"Are you running 11.10 with 1.0.4-1 version of udisks?" - That's right.
"Are you able to start palimpsest?" - Yes and no.. It starts but with no configuration, just it is not showing anything - blank space.. Terminal shows this error: "(palimpsest:15547): libgdu-WARNING **: Couldn't get daemon properties
Error creating pool: `(unspecified error)'".

I've executed "echo udisks install| sudo dpkg --set-selections" to unpin and installed with dpkg an existing package.
Of course patched with Your patch and built into deb.
This is my Disk Utility: http://imageshack.us/f/850/screenshotat20120307173.png/ (screenshot)
Do i need to reboot my laptop, to make these modifications active, everytime I make changes ?
Now, I have no "hold", installed version of udisks is 1.0.4-1 - patched and... what's next.. yeah.. that's the question :)
I don't know if this is important, but my ubuntu 11.10 is an upgrade from the 11.04 version..
But that was some time ago and udisks worked fine, gvfs etc.. just automounting worked great.
That's interesting that Paragon software could do something like this.. or.. maybe some updates did it.. hmm.. wondering what and where the problem is...

Revision history for this message
elviseftv (elviseftv) wrote :

Now to make sure I have Your patched version in the system installed, apt-get shows me to upgrade "udisks" - so it is good, cause there is no "hold" now. Ok.. firstly I thought this problem was only in GnomeShell, which I used recently, but now I know this affects all the system and the problem is elsewhere..

Revision history for this message
Mikhail Titov (mtitov) wrote :

@elvis_ef I suspect you are having a different issue. Is this relevant http://ubuntuforums.org/showthread.php?t=1721377 ?

My patch is only for this bug when unpatched palimpsest crashes as described by original poster. It can't help if you are having problems with udisks-daemon.

P.S. Generally there is no need to reboot a laptop unless it is a kernel related change or restart anything unless it is a daemon. So if palimpsest was crashing due to a failure of recursion depth assertion, installation of patched udisks is enough.

Revision history for this message
elviseftv (elviseftv) wrote :

hmm.. It seems You're right.. that's another problem..
I try to follow the topic You suggested..
Anyway, it's still a problem with udisks..
Wondering, if there is a possibility to completely remove udisks package from the system, not affecting the whole desktop...
Then I would install it again and check if there was a problem with a package or sth else..

Revision history for this message
elviseftv (elviseftv) wrote :

Anyway, thanks for Your effort Mikhail, Ill ty to do my best, to get my system working, or just reinstall it - clean 11.10, without upgrading from 11.04.. will see what the future brings..

Martin Pitt (pitti)
description: updated
Changed in gnome-disk-utility (Ubuntu):
status: Confirmed → Triaged
importance: Medium → High
Revision history for this message
Martin Pitt (pitti) wrote :

Mikhail, thanks a lot for your help here!

I have tried for an hour to replicate such a nested partition layout, but haven't succeeded so far. The easiest and safest is to do "sudo modprobe scsi_debug" and use the new virtual 8 MB device for this. I used sfdisk and fdisk trying to recreate such a structure, but no luck. Did you happen to succeed with this? If you have a small device with no actual data, it might also be possible to just dd it and compress the dump.

I'd like to be able to reproduce this to put it into udisks' test suite. Both udisks 1.x and libgdu (where this crash happens) are being deprecated, and I'd rather ensure that this bug does not happen again with udisks 2, or whatever the replacement will be in 5 years.

Thanks!

Revision history for this message
In , Martin Pitt (pitti) wrote :

Mikhail, thanks a lot for your help here!

I have tried for an hour to replicate such a nested partition layout, but haven't succeeded so far. The easiest and safest is to do "sudo modprobe scsi_debug" and use the new virtual 8 MB device for this. I used sfdisk and fdisk trying to recreate such a structure, but no luck. Did you happen to succeed with this? If you have a small device with no actual data, it might also be possible to just dd it and compress the dump.

I'd like to be able to reproduce this to put it into udisks' test suite. Both udisks 1.x and libgdu (where this crash happens) are being deprecated, and I'd rather ensure that this bug does not happen again with udisks 2, or whatever the replacement will be in 5 years.

Thanks!

Revision history for this message
In , Martin Pitt (pitti) wrote :

Oh, I just happened to crash gvfs-gdu-volume-monitor with that very problem (https://bugzilla.gnome.org/show_bug.cgi?id=622066). Now I need to find a way to reliably reproduce it..

Revision history for this message
In , Martin Pitt (pitti) wrote :

Sorry, I've been trying for 3.5 hours now, and I'm unable to reproduce this. Perhaps someone else has more luck than me?

Changed in gnome-disk-utility:
status: New → Confirmed
Revision history for this message
In , Mikhail Titov (mtitov) wrote :

@Martin

I did not know about scsi_debug. I'll see what I can do. But it is likely going to be later this week. And I have to unpatch udisk to actually reproduce it:-)

Otherwise, try creating few logical partitions, then discard offset pointers and replace those with the link pointing to the next partition. In terms of [1] just copy data for "Partition table's second entry" in place of "Partition table's first entry" and fill the former with 00s. You'll actually waste space on disk that was allocated for that partition. I guess GNU/Linux tools are smart enough not to insert such unnecessary stuff if you try to create 0 sized partition.

I have my dumps of my EMBR attached [2] within this post.

[1] http://en.wikipedia.org/wiki/Extended_boot_record
[2] https://bugs.freedesktop.org/attachment.cgi?id=49647

Changed in udisks:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Mikhail Titov (mtitov) wrote :

I just realized that I cannot fully test by using palimpsest as I do have broken partition table myself. However /lib/udev/udisks-part-id does report incorrectly partition type for scsi_debug device. Thus I think I reproduced it correctly. Here is how.

1. Create msdos partition table
2. Use sfdisk /dev/sdb < part.lst . Note that it will complain about creation of "empty" partition but still will do.
3. /lib/udev/udisks-part-id /dev/sdb5 will report "mbr" instead of anything else

Revision history for this message
Mikhail Titov (mtitov) wrote :

oops. Disregard previous post as I can't delete it. part-id does report UDISKS_PARTITION_TYPE=0x83 and not 0x05

Revision history for this message
Mikhail Titov (mtitov) wrote :

The following should be step 2.5 (i.e. between 2. and 3.)

dd if=/dev/sdb1 of=/dev/sdb1 seek=446 skip=462 count=16 bs=1
dd if=/dev/zero of=/dev/sdb1 seek=462 count=16 bs=1

Explanation:

It turned out that though sfdisk recognized an attempt to write 0-sized partition, it still writes correct entry in EBR. To alleviate that I simply move second entry on place of first one and fill second entry with zeros. It triggers udisks into thinking it was the last one.

Revision history for this message
Mikhail Titov (mtitov) wrote :

Here is the "screenshot" from my terminal showing part-id results on scsi_debug device before and after my patch. Look at UDISKS_PARTITION_TYPE . Before it was reported as 0x05 and after I installed patched version back, it became 0x83 as it is supposed to be.

From what I remember (it was > 0.5 year ago) libgdu was trying to figure out the "parent" for a given partition and it relies on udisks reports which mislead it in an attempt to figure out the parent.

Revision history for this message
Andrei Dziahel (develop7) wrote :

I'm affected this issue too, but patched udisks worked for me. Can we have this patch in ubuntu-proposed at least?

Revision history for this message
Bartlomiej Skwira (lol12121deactivatedaccount-deactivatedaccount) wrote :

This was also affecting me, but with the help of Mikhail (thank You bro! can I send U a beer? ;) - comment #46 - my drives are mounting properly.

Unfortunately I also had a problem with partition table (disk utility showed a huge - kazillion TB - empty partition with at the end of disk, GParted showed the whole disk as unallocated). So I used 'testdisk' to analyze partitions. It found the inconsistency and wrote a new partition table. This fraked up GRUB, so I booted with an installation cd (Ubuntu 12.04), downloaded boot-repair, run the repair, reboot, and everything is ok now!! HURRAY! These steps can probably be done faster/better by someone more experienced.

Revision history for this message
Mikhail Titov (mtitov) wrote :

Bartolomiej, sure, you can send me one:-) Though a wheatgrass shot is preferred.

In case someone has no skills to apply a patch, here is the link to ppa for oneiric https://launchpad.net/~mtitov/+archive/udisks

Revision history for this message
In , Zeuthen (zeuthen) wrote :

In udisks 2.0 this is now handled by libblkid through invocation from udev so I'm closing this NOTOURBUG.

That said, if you don't mind, please test if it's the problem also exists with that codebase (it's completely different from udisks-part-id). Thanks!

Changed in udisks:
status: Confirmed → Won't Fix
Changed in gnome-disk-utility:
status: Confirmed → Expired
Revision history for this message
Jan Cejka (jan-cejka) wrote :

Solution if you want to fix it permanently yourself without patching udisks - see Bug #1093901 comment #3 - worked for me.

- Problem was nested extended partition
- Easy check that you are affected - sudo fdisk -l /dev/sda (if problematic disk is /dev/sda) returns first row "omitting empty partition (5)")
- Proper check - sudo dd if=/dev/sda2 count=1 | hexdump returns only 1 extended partition with type 05 (if extended partition is /dev/sda2)

As I have written above - solution here: https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/1093901/comments/3

inuyasha (qycoxx-gmail)
Changed in gnome-disk-utility (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.