Bug 15304

Summary: drakdisk crashed (Illegal division by zero at diskdrake/interactive.pm line 1409, "/ $hd->cylinder_size" (really extent_size for LVs)
Product: Mageia Reporter: Dave Hodgins <davidwhodgins>
Component: RPM PackagesAssignee: Thierry Vignaud <thierry.vignaud>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Normal CC: thierry.vignaud
Version: 4Keywords: NEEDINFO
Target Milestone: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Source RPM: drakxtools-curses-16.26.12-1.mga4 CVE:
Status comment:
Attachments: Output of pvs and lvs commands
Output of vgdisplay, pvdisplay, lvdisplay and lvm2 vgs commands
Compressed output of diskdrake &> /tmp/LOG.hd

Description Dave Hodgins 2015-02-16 17:36:56 CET
The "drakdisk" program crashed. Drakbug-16.26.12 caught it.

In a Mageia 4 i586 system, in diskdrake, clicked on the lvm physical volume.
# lspcidrake
unknown         : Advanced Micro Devices, Inc. [AMD/ATI]|RV280 [Radeon 9200 SE] (Secondary) [DISPLAY_OTHER] (rev: 01)
Card:ATI Radeon HD 4870 and earlier: Advanced Micro Devices, Inc. [AMD/ATI]|RV280 [Radeon 9200 SE] [DISPLAY_VGA] (rev: 01)
pata_via        : VIA Technologies, Inc.|VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE [STORAGE_IDE] (rev: 06)
unknown         : Intel Corporation|536EP Data Fax Modem [COMMUNICATION_OTHER]
via_rhine       : VIA Technologies, Inc.|VT6102 [Rhine-II] [NETWORK_ETHERNET] (rev: 78)
snd_via82xx     : VIA Technologies, Inc.|VT8233/A/8235/8237 AC97 Audio Controller [MULTIMEDIA_AUDIO] (rev: 60)
i2c_viapro      : VIA Technologies, Inc.|VT8237 ISA bridge [KT600/K8T800/K8T890 South] [BRIDGE_ISA]
ehci_pci        : VIA Technologies, Inc.|USB 2.0 [SERIAL_USB] (rev: 86)
uhci_hcd        : VIA Technologies, Inc.|VT82xxxxx UHCI USB 1.1 Controller [SERIAL_USB] (rev: 81)
uhci_hcd        : VIA Technologies, Inc.|VT82xxxxx UHCI USB 1.1 Controller [SERIAL_USB] (rev: 81)
uhci_hcd        : VIA Technologies, Inc.|VT82xxxxx UHCI USB 1.1 Controller [SERIAL_USB] (rev: 81)
uhci_hcd        : VIA Technologies, Inc.|VT82xxxxx UHCI USB 1.1 Controller [SERIAL_USB] (rev: 81)
shpchp          : VIA Technologies, Inc.|VT8237/VX700 PCI Bridge [BRIDGE_PCI]
unknown         : VIA Technologies, Inc.|CN333/CN400/PM880 Host Bridge [BRIDGE_HOST]
unknown         : VIA Technologies, Inc.|CN333/CN400/PM880 Host Bridge [BRIDGE_HOST]
unknown         : VIA Technologies, Inc.|CN333/CN400/PM880 Host Bridge [BRIDGE_HOST]
unknown         : VIA Technologies, Inc.|CN333/CN400/PM880 CPU Host Bridge [BRIDGE_HOST]
unknown         : VIA Technologies, Inc.|CN333/CN400/PM880 Host Bridge [BRIDGE_HOST]
unknown         : VIA Technologies, Inc.|CN333/CN400/PM880 Host Bridge [BRIDGE_HOST]
hub             : Linux 3.14.32-desktop-1.mga4 uhci_hcd|UHCI Host Controller [Hub|Unused|Full speed (or root) hub]
hub             : Linux 3.14.32-desktop-1.mga4 ehci_hcd|EHCI Host Controller [Hub|Unused|Full speed (or root) hub]
hub             : Linux 3.14.32-desktop-1.mga4 uhci_hcd|UHCI Host Controller [Hub|Unused|Full speed (or root) hub]
hub             : Linux 3.14.32-desktop-1.mga4 uhci_hcd|UHCI Host Controller [Hub|Unused|Full speed (or root) hub]
hub             : Linux 3.14.32-desktop-1.mga4 uhci_hcd|UHCI Host Controller [Hub|Unused|Full speed (or root) hub]
usbfs           : American Power Conversion|Back-UPS XS 1300G FW:864.L6 .D USB FW:L6  [Human Interface Device|No Subclass|None]

Illegal division by zero at /usr/lib/libDrakX/diskdrake/interactive.pm line 1409.
Perl's trace:
standalone::bug_handler() called from /usr/lib/perl5/vendor_perl/5.18.1/Gtk3.pm:295
Gtk3::__ANON__() called from /usr/lib/libDrakX/mygtk3.pm:1502
mygtk3::main() called from /usr/lib/libDrakX/ugtk3.pm:749
ugtk3::main() called from /usr/lib/libDrakX/diskdrake/hd_gtk.pm:132
diskdrake::hd_gtk::main() called from /usr/libexec/drakdisk:93

Theme name: oxygen-gtk
Kernel version = 3.14.32-desktop-1.mga4
Distribution=Mageia release 4 (Official) for i586
CPU=Intel(R) Celeron(R) CPU 2.40GHz
Comment 1 Dave Hodgins 2015-02-16 18:01:15 CET
Created attachment 5922 [details]
Output of pvs and lvs commands
Comment 2 Thierry Vignaud 2015-02-18 16:55:04 CET
It fails when trying to divide by cylinder size, which for LVMs is implemented in lvm.pm:

sub cylinder_size {
    my ($hd) = @_;
    $hd->{extent_size};
}

So it looks like it fails to retrieve the extent size (which should be 4Mb)

Can you attach the output of pvdisplay, vgdisplay & lvdisplay?

Keywords: (none) => NEEDINFO
CC: (none) => thierry.vignaud
Assignee: bugsquad => thierry.vignaud
Summary: drakdisk crashed => drakdisk crashed (Illegal division by zero at diskdrake/interactive.pm line 1409, "/ $hd->cylinder_size")

Thierry Vignaud 2015-02-18 16:55:18 CET

Summary: drakdisk crashed (Illegal division by zero at diskdrake/interactive.pm line 1409, "/ $hd->cylinder_size") => drakdisk crashed (Illegal division by zero at diskdrake/interactive.pm line 1409, "/ $hd->cylinder_size" (really extent_size for LVs)

Comment 3 Thierry Vignaud 2015-02-18 16:57:11 CET
Also, what's the output of:
lvm2 vgs --noheadings --nosuffix --units s -o vg_extent_size <vg_name>

which is how we retrieve the value

(Just put the right VG name in place of "<vg_name>")
Comment 4 Dave Hodgins 2015-03-01 20:48:50 CET
Created attachment 5969 [details]
Output of vgdisplay, pvdisplay, lvdisplay and lvm2 vgs commands

One strange thing with the lvm2 vgs command for the vg 91. Even though the
output is being redirected to a file, for this one vg, the output still goes
to the terminal.

# lvm2 vgs --noheadings --nosuffix --units s -o vg_extent_size 91>>lvm.txt 2>&1
File descriptor 91 (/root/lvm.txt) leaked on lvm2 invocation. Parent PID 12702: -bash
    Logging initialised at Sun Mar  1 14:40:03 2015
    Set umask from 0022 to 0077
vgs    Finding all volume groups
vgs    Finding volume group "bk"
vgs    Finding volume group "91"
vgs    Finding volume group "a8"
vgs  8192
vgs  8192
vgs  8192
vgs    Wiping internal VG cache

Also note that the logical volumes 91-data and bk-data are luks file system
base devices.

Sorry for the delay responding.
Comment 5 Thierry Vignaud 2015-03-02 06:37:15 CET
That's b/c as "91" is a number, it's interpreted as file descriptor by bash.
Adding a space between "91" & ">>" would have fixed that.

Can you try altering "sub cylinder_size" in /usr/lib/libDrakX/lvm.pm?
As root, change:

sub cylinder_size {
    my ($hd) = @_;
    $hd->{extent_size};
}

into:


sub cylinder_size {
    my ($hd) = @_;
    use Data::Dumper; warn Dumper $hd;
    $hd->{extent_size};
}


Then run "diskdrake &> /tmp/LOG.hd" and attach the resulting file
Comment 6 Dave Hodgins 2015-03-03 00:07:40 CET
(In reply to Thierry Vignaud from comment #5)
> That's b/c as "91" is a number, it's interpreted as file descriptor by bash.
> Adding a space between "91" & ">>" would have fixed that.

Ahh. Thanks for that.

> Can you try altering "sub cylinder_size" in /usr/lib/libDrakX/lvm.pm?
> As root, change:
> into:
> sub cylinder_size {
>     my ($hd) = @_;
>     use Data::Dumper; warn Dumper $hd;
>     $hd->{extent_size};
> }
> Then run "diskdrake &> /tmp/LOG.hd" and attach the resulting file

Tried that. /tmp/LOG.hd was empty. I'll attach the output that went to
the terminal, though I don't think there's anything new in it.
Comment 7 Dave Hodgins 2015-03-03 00:10:00 CET
Created attachment 5974 [details]
Compressed output of diskdrake &> /tmp/LOG.hd
Comment 8 Thierry Vignaud 2015-03-03 09:10:12 CET
Sg has changed and diskdrake fails to parse lvm2 output:

    'VG_name' => 'pvs',
                 ///\\\
Comment 9 Thierry Vignaud 2015-03-03 21:27:33 CET
I failed to reproduce.

The output in comment #4 shows that you altered /etc/lvm/lvm.conf in order to make all lvm commands very verbose by default, which breaks tools that try parse their output.

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX

Comment 10 Dave Hodgins 2015-03-04 05:40:52 CET
Thanks. diskdrake is working now. I don't remember having changed the
verbose setting, though as the 91 and bk volume groups were created
for Mandriva 2009.1, it's quite probable I did change it, and have
simply forgotten having done so.