Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 160796

Summary: vmstat crashes when accessing LVM partition.
Product: [Fedora] Fedora Reporter: Konstantin Antselovich <konstantin>
Component: procpsAssignee: Karel Zak <kzak>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 4CC: albert, zing
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-11 11:28:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Konstantin Antselovich 2005-06-17 11:22:03 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
vmstat segfaults with '***Bufferoverflow detected***' when trying to check block IO on LVM-based partition

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

How reproducible:

Steps to Reproduce:
1. sudo vmstat -p /dev/YourVolumeGroup/YourLogicalVolume

Actual Results:  *** buffer overflow detected ***: vmstat terminated
<see details below>

Expected Results:  <partition name>   reads   read sectors  writes    requested writes
                   2          4        0          0

Additional info:

[konstantin@lifebook Desktop]$ uname -a
Linux lifebook.myhome 2.6.12-rc6-ck2 #1 Wed Jun 15 20:55:41 PDT 2005 i686 i686 i386 GNU/Linux
[konstantin@lifebook Desktop]$ rpm -q procps
[konstantin@lifebook Desktop]$ vmstat -V
procps version 3.2.5
[konstantin@lifebook Desktop]$ sudo vmstat -p /dev/fedora3/home
*** buffer overflow detected ***: vmstat terminated
======= Backtrace: =========
======= Memory map: ========
00470000-0048a000 r-xp 00000000 fd:00 45094      /lib/
0048a000-0048b000 r--p 00019000 fd:00 45094      /lib/
0048b000-0048c000 rw-p 0001a000 fd:00 45094      /lib/
00492000-005b6000 r-xp 00000000 fd:00 45103      /lib/
005b6000-005b8000 r--p 00124000 fd:00 45103      /lib/
005b8000-005ba000 rw-p 00126000 fd:00 45103      /lib/
005ba000-005bc000 rw-p 005ba000 00:00 0
005be000-005ca000 r-xp 00000000 fd:00 45189      /lib/
005ca000-005cb000 rw-p 0000c000 fd:00 45189      /lib/
005cb000-005d0000 rw-p 005cb000 00:00 0
007fc000-00805000 r-xp 00000000 fd:00 45218      /lib/
00805000-00806000 rw-p 00009000 fd:00 45218      /lib/
08048000-0804c000 r-xp 00000000 fd:00 549501     /usr/bin/vmstat
0804c000-0804e000 rw-p 00003000 fd:00 549501     /usr/bin/vmstat
0804e000-0806f000 rw-p 0804e000 00:00 0          [heap]
b7f26000-b7f28000 rw-p b7f26000 00:00 0
bf92f000-bf944000 rw-p bf92f000 00:00 0          [stack]
ffffe000-fffff000 ---p 00000000 00:00 0          [vdso]

Comment 1 Karel Zak 2005-06-21 11:41:34 UTC
It's pretty stupid bug in main():

   char partition[16];
   sprintf(partition, "%s", *argv);

It will be fixed in next procps update with some othes things (I don't want to
release update for this minor bug only).

Note, you have to use vmstat without full path to device. Please, see "cat
/proc/diskstats" (e.g. "hda1" and no "/dev/hda1"). And it works with physical
partitions -- logical LVM things are virtual and linux kernel doesn't provide
statistic information about that.

Comment 2 Karel Zak 2005-07-11 11:28:07 UTC
Fixed in procps-3.2.5-6.3 (FC4) and procps-3.2.3-5.3 (FC3).