Bug 366971 - parted print command crashes with Xen xvd disks
parted print command crashes with Xen xvd disks
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: parted (Show other bugs)
All Linux
high Severity high
: ---
: ---
Assigned To: David Cantrell
Brock Organ
: 254621 280181 (view as bug list)
Depends On:
Blocks: RHEL5u2_relnotes
  Show dependency treegraph
Reported: 2007-11-05 11:06 EST by Bryn M. Reeves
Modified: 2010-10-22 16:03 EDT (History)
5 users (show)

See Also:
Fixed In Version: RHBA-2008-0322
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-21 12:55:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
fix parted print command for xvd devices (805 bytes, patch)
2007-11-05 11:09 EST, Bryn M. Reeves
no flags Details | Diff

  None (edit)
Description Bryn M. Reeves 2007-11-05 11:06:58 EST
Description of problem:
The parted patch to introduce XVD (xen virtual device) support doesn't update
the string table parted uses to print descriptions for different device types
("transports" in parted).

This causes parted to die with a message like this when run against an XVD device:

        [root@dhcp-5-79 ~]# parted /dev/xvda
        GNU Parted 1.8.1
        Using /dev/xvda
        Welcome to GNU Parted! Type 'help' to view a list of commands.
        (parted) p                                                               
        Model: Xen Virtual Block Device (
        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:
        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:
        for further information.
        Your report should contain the version of this release (1.8.1)
        along with the error message below, the output of
               parted DEVICE unit co print unit s print
        and additional information about your setup you consider important.
        Error: SEGV_MAPERR (Address not mapped to object)Aborted (core dumped)

Running the suggested "parted DEVICE unit co print unit s print" command
causes parted to get stuck in a loop in strlen.

Disabling the segfault handler gives corrupted output of the device
description, pointing at a problem in the do_print function.

The do_print routine has a table mapping PED_DEVICE_* types to string
descriptions. This was not updated to include a description for XVD devices,
causing the routine to overshoot the end of the array and either segfault or
loop inside strlen (and then eventually segfault).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. start parted with an xvd device on the commandline, e.g.:
   $ parted /dev/xvda
2. Run the print ("p") command
Actual results:
Parted dies with the above message. If the segfault handler is disabled output
appears but the device description is garbage.

Expected results:
Parted handles xvd devices properly and prints the partition table.

Additional info:
Comment 1 Bryn M. Reeves 2007-11-05 11:09:28 EST
Created attachment 248381 [details]
fix parted print command for xvd devices

Fix the transport array in do_print:

-	 char*		 transport[13] = {"unknown", "scsi", "ide", "dac960",
+	 char*		 transport[14] = {"unknown", "scsi", "ide", "dac960",
					  "cpqarray", "file", "ataraid", "i2o",

-					  "ubd", "dasd", "viodasd", "sx8",
+					  "ubd", "dasd", "viodasd", "sx8",
+					 "xvd"};
Comment 2 RHEL Product and Program Management 2007-11-05 11:16:39 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 4 Bryn M. Reeves 2007-11-08 04:32:00 EST
Partner has tested & verified the patch in comment #1
Comment 5 David Cantrell 2007-12-18 23:15:06 EST
*** Bug 254621 has been marked as a duplicate of this bug. ***
Comment 6 David Cantrell 2007-12-19 00:28:00 EST
Fixed in parted-1.8.1-14.el5, moving to MODIFIED.
Comment 8 Chris Lalancette 2008-01-23 17:34:18 EST
*** Bug 280181 has been marked as a duplicate of this bug. ***
Comment 11 Don Domingo 2008-02-20 19:05:12 EST
added to RHEl5.2 release notes under "Resolved Issues":

(ia64) Parted can now understand and correctly print out Xen Virtual Device
(XVD) partition labels. This enables paravirtualized guests to now use the
parted utility. As such, you no longer need to use parted within dom0 to
configure disk partitions on paravirtualized guests.

please advise if any further revisions are required. thanks!
Comment 12 Bryn M. Reeves 2008-02-21 05:27:37 EST
Does this need the "(ia64)" tag? The original problem in parted occurred
irrespective of architecture. (Sorry if I've misunderstood comment #11).
Comment 13 Aron Griffis 2008-02-21 15:47:58 EST
The reason this has the ia64 tag is that parted is required on ia64, because
fdisk doesn't understand EFI GUID Partition Tables (aka GPT).  Most i386/x86_64
use DOS partition tables by default, so they're able to use fdisk.

However you're right, the bug would affect any architecture that uses GPT. 
Since there are x86_64 machines using EFI now, I suspect they're also using GPT
and would suffer from this bug.

Hope that helps.
Comment 14 Don Domingo 2008-02-21 17:56:54 EST
Thanks Bryn, Aron. removed ia64 tag, release note will be available in all
Comment 15 Stuart Sears 2008-02-22 06:12:26 EST
This appears to be the underlying cause of #433950, which I opened probably
before searching for parted bugs. My fault, sorry. This breaks conga's storage
management  when using Xen VMs as cluster nodes.
Comment 16 Bryn M. Reeves 2008-02-26 05:05:34 EST
Right, doesn't actually need any GPT in use - my tests were done with no GPT,
iirc. Stuart, if you want I can give you some test packages & you can confirm
bug 433950 is a dup of this one if you like?
Comment 17 Don Domingo 2008-04-01 22:17:37 EDT
the RHEL5.2 release notes will be dropped to translation on April 15, 2008, at
which point no further additions or revisions will be entertained.

a mockup of the RHEL5.2 release notes can be viewed at the following link:

please use the aforementioned link to verify if your bugzilla is already in the
release notes (if it needs to be). each item in the release notes contains a
link to its original bug; as such, you can search through the release notes by
bug number.

Comment 20 errata-xmlrpc 2008-05-21 12:55:57 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.