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   
Whiteboard:
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):
procps-3.2.5-6

How reproducible:
Always

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

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
procps-3.2.5-6
[konstantin@lifebook Desktop]$ vmstat -V
procps version 3.2.5
[konstantin@lifebook Desktop]$ sudo vmstat -p /dev/fedora3/home
Password:
*** buffer overflow detected ***: vmstat terminated
======= Backtrace: =========
/lib/libc.so.6(__chk_fail+0x41)[0x570565]
/lib/libc.so.6(__vsprintf_chk+0x0)[0x56fe30]
/lib/libc.so.6(_IO_default_xsputn+0x97)[0x4f2b58]
/lib/libc.so.6(_IO_vfprintf+0x363f)[0x4d03a1]
/lib/libc.so.6(__vsprintf_chk+0xa1)[0x56fed1]
/lib/libc.so.6(__sprintf_chk+0x30)[0x56fe24]
vmstat[0x804a1be]
/lib/libc.so.6(__libc_start_main+0xc6)[0x4a6de6]
vmstat[0x8048af1]
======= Memory map: ========
00470000-0048a000 r-xp 00000000 fd:00 45094      /lib/ld-2.3.5.so
0048a000-0048b000 r--p 00019000 fd:00 45094      /lib/ld-2.3.5.so
0048b000-0048c000 rw-p 0001a000 fd:00 45094      /lib/ld-2.3.5.so
00492000-005b6000 r-xp 00000000 fd:00 45103      /lib/libc-2.3.5.so
005b6000-005b8000 r--p 00124000 fd:00 45103      /lib/libc-2.3.5.so
005b8000-005ba000 rw-p 00126000 fd:00 45103      /lib/libc-2.3.5.so
005ba000-005bc000 rw-p 005ba000 00:00 0
005be000-005ca000 r-xp 00000000 fd:00 45189      /lib/libproc-3.2.5.so
005ca000-005cb000 rw-p 0000c000 fd:00 45189      /lib/libproc-3.2.5.so
005cb000-005d0000 rw-p 005cb000 00:00 0
007fc000-00805000 r-xp 00000000 fd:00 45218      /lib/libgcc_s-4.0.0-20050520.so.1
00805000-00806000 rw-p 00009000 fd:00 45218      /lib/libgcc_s-4.0.0-20050520.so.1
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]
Aborted

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).