bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: J. Nick Terry
Subject: [bug #31045] parttool performs the wrong command when two commands given
Date: Wed, 15 Sep 2010 19:08:06 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.53 Safari/534.3

URL:
  <http://savannah.gnu.org/bugs/?31045>

                 Summary: parttool performs the wrong command when two
commands given
                 Project: GNU GRUB
            Submitted by: caspin
            Submitted on: Wed 15 Sep 2010 07:08:05 PM GMT
                Category: Disk &amp; Partition
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: J. Nick Terry
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: 1.98
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

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.







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31045>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]