bugGNU GRUB - Bugs: bug #31045, parttool performs the wrong...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #31045: parttool performs the wrong command when two commands given

Submitter:  J. Nick Terry <caspin>
Submitted:  Wed 15 Sep 2010 07:08:05 PM UTC
   
 
Category:  Disk & Partition Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  J. Nick Terry
Open/Closed:  Closed Release:  1.98
Release:  Reproducibility:  Every Time
Planned Release:  None

Wed 15 Sep 2010 10:24:05 PM UTC, comment #3: 

I fixed the bug in response to your report ;)

Vladimir Serbinenko <phcoder>
Group administrator
Wed 15 Sep 2010 10:02:53 PM UTC, comment #2: 

I build grub from the trunk and problem was resolved.

Has there been work in parttool since 1.98?

or was this a bug introduced by Ubuntu?

J. Nick Terry <caspin>
Wed 15 Sep 2010 07:50:06 PM UTC, comment #1: 

Can you retest the bzt trunk?

Vladimir Serbinenko <phcoder>
Group administrator
Wed 15 Sep 2010 07:08:05 PM UTC, original submission:  

parttool doesn't fail every time, but it fails more often than it succeeds.
It only fails with the commands 'hidden' then 'boot'.
It doesn't seem to fail with 'boot' then 'hidden'.
It doesn't seem to fail when either 'boot' or 'hidden' are used alone.
I didn't experiment with the 'type=' command.
It can fail when setting any of the partitions.

My setup:
a small 8GB disk with 4 partitions.
hd0,1 is a DOS partition, id 0x6
hd0,2 is a Windows partition, id 0x7
hd0,3 is a Windows partition, id 0x7
hd0,4 is an Ubuntu partition, id 0x83
Grub was installed from an Ubuntu 10.4 box using package
grub-pc 1.98-1ubuntu7

I wrote function that dumps fields 0 and 4 from the MBR's partition table called partinfo for each partition.

Here is particularly telling example.

grub> parttool hd0,4 hidden+ boot-  #1
Setting partition type to 0x93
Cleared active flag on 3.
grub> parttool hd0,4 hidden- boot-  #2
Setting partition type to 0x83
Cleared active flag on 3.
grub> parttool hd0,4 hidden- boot-  #3
Setting partition type to 0x93
grub> partinfo                      #4
...
grub> parttool hd0,4 hidden- boot-  #5
Setting partition type to 0x93
grub> parttool hd0,4 hidden- boot-  #6
Setting partition type to 0x93
grub> parttool hd0,4 hidden- boot+  #7
Setting partition type to 0x93
grub> parttool hd0,4 hidden+ boot+  #8
Setting partition type to 0x93
grub> parttool hd0,4 hidden+ boot-  #9
Setting partition type to 0x93

Commands #1 and #2 worked as expected. #3-#9 all failed.

I verified with partinfo at #4 that partition 4 had actually be set to 0x93.  When I requested hidden- boot- it performed a hidden+.

I have had parttool set a partition to unhidden as well as hidden when it fails.

Notice that #3-#9 the output only mentions changing the type.  parttool is not performing the second command (boot) at all.

For me the most disturbing is that parttool does not fail every time and it does not fail in the same way.  That smells like a race (not possible as I don't think grub2 uses threading), reading uninitialized memory, or a stack smash.



J. Nick Terry <caspin>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by caspin (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-15 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2010-09-15 caspin Carbon-CopyRemoved -email is unavailable- -
    2010-09-15 caspin Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code