[illumos] [OpenIndiana Distribution - Bug #4098] GNU parted "crash" (well, sort of)

illumos project devnull at illumos.org
Fri Sep 6 08:39:19 UTC 2013


Issue #4098 has been updated by Erik Larsson.


Update: I now know where the number 625137408 comes from. There seems to be some disagreement within the kernel regarding the size/capacity of this hard drive.
For /dev/rdsk/c5d0 DKIOCGMEDIAINFO says 625137408, while DKIOCEXTPARTINFO says 625142448 (which is correct).

Notably, DKIOCGMEDIAINFOEXT does not work for this particular device, which is also strange.
Also the eSATA device is not AHCI-connected due to some limitation in the controller.

In Linux (on the same hardware), the device size is consistently shown as 625142448 sectors. E.g.
<pre>
$ sudo parted /dev/sde
GNU Parted 2.3
Använder /dev/sde
Välkommen till GNU Parted! Skriv "hjälp" för att visa en lista över kommandon.
(parted) unit s                                                           
(parted) print                                                           
Modell: ATA WDC WD3200BEVT-2 (scsi)
Disk /dev/sde: 625142448s
Sektorstorlek (logisk/fysisk): 512B/512B
Partitionstabell: gpt

Nummer  Början      Slut        Storlek     Filsystem       Namn                   Flaggor
 1      40s         409639s     409600s     fat32           EFI System Partition   startbar
 2      409640s     273039400s  272629761s  hfs+            Apple_HFS_Untitled_2
 3      273301545s  378159145s  104857601s  hfs+            Apple_HFSX_Untitled_2
 4      378421290s  483278890s  104857601s  ntfs            Untitled 2
 5      483541035s  588398635s  104857601s  hfs+            Apple_HFS_Untitled_2
 6      588398636s  588400589s  1954s                                              bios_grub
 7      588400590s  623515824s  35115235s   ext4
 8      623515825s  625142414s  1626590s    linux-swap(v1)
</pre>

...and no problem is detected.

In addition, I can access the last sector of the device from within OpenIndiana:
<pre>
$ sudo dd if=/dev/rdsk/c5d0 of=lastsector bs=512 skip=625142447 count=1
Password: 
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0,0352888 s, 14,5 kB/s
</pre>
...but not the sector after the last sector:
<pre>
$ sudo dd if=/dev/rdsk/c5d0 of=lastsector bs=512 skip=625142448 count=1
0+0 records in
0+0 records out
0 bytes (0 B) copied, 6,7277e-05 s, 0,0 kB/s
</pre>
So the value returned by DKIOCGMEDIAINFO is clearly incorrect.

----------------------------------------
Bug #4098: GNU parted "crash" (well, sort of)
https://www.illumos.org/issues/4098

Author: Erik Larsson
Status: New
Priority: Normal
Assignee: OI illumos
Category: OS/Net (Kernel and Userland)
Target version: 
Difficulty: Medium
Tags: parted


When running parted on my eSATA-connected hard drive I get the following output:
---
<pre>
$ sudo parted /dev/dsk/c5d0
GNU Parted 1.8.8
Using /dev/dsk/c5d0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
print
Backtrace has 7 calls on stack:
  7: /usr/lib/libparted.so.8'ped_assert+0x33 [0xfeef5be7]
  6: /usr/lib/libparted.so.8'gpt_read+0x13a [0xfef31546]
  5: /usr/lib/libparted.so.8'ped_disk_new+0x93 [0xfeef9d8f]
  4: /usr/sbin/parted'do_print+0x84 [0x8056fe8]
  3: /usr/sbin/parted'interactive_mode+0xe3 [0x805c0a3]
  2: /usr/sbin/parted'main+0x56 [0x805959a]
  1: /usr/sbin/parted'_start+0x7d [0x8054d0d]
                                                                          

You found a bug in GNU Parted! Here's what you have to do:

Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:

Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:

        http://ftp.gnu.org/gnu/parted/

Please check this version prior to bug reporting.

If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:

        http://www.gnu.org/software/parted

for further information.

Your report should contain the version of this release (1.8.8)
along with the error message below, the output of

        parted DEVICE unit co print unit s print

and the following history of commands you entered.
Also include any additional information about your setup you
consider important.

Assertion ((PedSector) PED_LE64_TO_CPU (gpt->AlternateLBA) <= disk->dev->length
- 1) at unknown:0 in function unknown() failed.

Ignore/Cancel? i                                                          
i
Backtrace has 8 calls on stack:
  8: /usr/lib/libparted.so.8'ped_assert+0x33 [0xfeef5be7]
  7: /usr/lib/libparted.so.8'_parse_header+0x171 [0xfef30e61]
  6: /usr/lib/libparted.so.8'gpt_read+0x179 [0xfef31585]
  5: /usr/lib/libparted.so.8'ped_disk_new+0x93 [0xfeef9d8f]
  4: /usr/sbin/parted'do_print+0x84 [0x8056fe8]
  3: /usr/sbin/parted'interactive_mode+0xe3 [0x805c0a3]
  2: /usr/sbin/parted'main+0x56 [0x805959a]
  1: /usr/sbin/parted'_start+0x7d [0x8054d0d]
                                                                          

You found a bug in GNU Parted! Here's what you have to do:

Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:

Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:

        http://ftp.gnu.org/gnu/parted/

Please check this version prior to bug reporting.

If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:

        http://www.gnu.org/software/parted

for further information.

Your report should contain the version of this release (1.8.8)
along with the error message below, the output of

        parted DEVICE unit co print unit s print

and the following history of commands you entered.
Also include any additional information about your setup you
consider important.

Assertion (last_usable <= disk->dev->length) at unknown:0 in function unknown()
failed.

Ignore/Cancel? i                                                          
i
Error: Can't have a partition outside the disk!                           
Error: Can't have a partition outside the disk!                           
(parted) q                                                                
q
</pre>
---

<notextile>"iostat -E" says the following about the attached disk:</notextile>
---
<pre>
cmdk0     Soft Errors: 0 Hard Errors: 0 Transport Errors: 0 
Model: WDC WD3200BEVT- Revision:  Serial No:      WD-WXE508N Size: 320,07GB <320070352896 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 
Illegal Request: 0 
</pre>
---

The kernel can apparently read the GPT partition table properly, as evidenced by the output of a small utility that I wrote myself, which simply issues the DKIOCEXTPARTINFO IOCTL and displays the result:
---
<pre>
$ sudo bin/getpartinfo /dev/rdsk/c5d0
p_start: 0
p_length: 625142448
$ sudo bin/getpartinfo /dev/rdsk/c5d0s0
p_start: 40
p_length: 409600
$ sudo bin/getpartinfo /dev/rdsk/c5d0s1
p_start: 409640
p_length: 272629761
$ sudo bin/getpartinfo /dev/rdsk/c5d0s2
p_start: 273301545
p_length: 104857601
$ sudo bin/getpartinfo /dev/rdsk/c5d0s3
p_start: 378421290
p_length: 104857601
$ sudo bin/getpartinfo /dev/rdsk/c5d0s4
p_start: 483541035
p_length: 104857601
$ sudo bin/getpartinfo /dev/rdsk/c5d0s5
p_start: 588398636
p_length: 1954
$ sudo bin/getpartinfo /dev/rdsk/c5d0s6
p_start: 588400590
p_length: 35115235
</pre>
---

This disk has the hybrid MBR/GPT partition scheme that Apple uses (formatted on a Mac), but I'm not sure that has anything to do with the bug.

The parted version is very recent (system was 'pkg update':ed to oi_151a8 a few days ago):
---
<pre>
$ pkg info parted
          Namn: system/storage/parted
       Sammanfattning: GNU Parted - Partition Editor
   Beskrivning: GNU Parted is for the display and manipulation of disk
                partitions
      Kategori: System/Administration and Configuration
        Status: Installerat
      Utgivare: openindiana.org
       Version: 1.8.8
Kompilering släppt: 5.11
          Gren: 0.151.1.8
Paketeringsdatum: 21 juli 2013 13:38:59 
       Storlek: 898.65 kB
          FMRI: pkg://openindiana.org/system/storage/parted@1.8.8,5.11-0.151.1.8:20130721T133859Z
</pre>
---
(Apologies for the Swedish localization, but you probably understand.)

I do not know if this is a regression since I didn't ever attach this hard drive to OI until now.
This is the first time I report a bug here, so please get back to me if more info is needed. I put this category kernel/userland, which seemed to be the best match.


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://www.illumos.org/my/account



More information about the illumos-team mailing list