Bug 109147
Summary: | vmstat dies parsing /proc/stats | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Shantanu Goel <sgoel01> |
Component: | procps | Assignee: | Karel Zak <kzak> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | CC: | laroche |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-05-20 03:25:49 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 132991 |
Description
Shantanu Goel
2003-11-04 23:52:04 UTC
Can you reproduce this with procps 3.1.15? this seems to be fixed in procps 3.x, but exists in procps 2.0.17 which is what core one uses. I have the answer to this problem.: I did a strace and looked at the code and i've found what i think is a problem. there is a race condition in getrunners() if a program exits between the readdir(proc) and the open() vmstat will die. if /proc/pid/stat is missing, I think it should be assumed that the process has died, and continue gracefully if the errno is file not found. look at line 48 vmstat.c in 2.0.17 strace reveals: open("/proc/16928/stat", O_RDONLY) = 5 read(5, "16928 (bash) S 16908 10483 4568 "..., 1023) = 209 close(5) = 0 open("/proc/16929/stat", O_RDONLY) = -1 ENOENT (No such file or directory) dup(2) = 5 fcntl64(5, F_GETFL) = 0x2 (flags O_RDWR) fstat64(5, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf512000 _llseek(5, 0, 0xbff811b8, SEEK_CUR) = -1 ESPIPE (Illegal seek) write(5, "open: No such file or directory\n", 32open: No such file or directory ) = 32 close(5) = 0 munmap(0xbf512000, 4096) = 0 write(2, "error: failed to parse /proc/sta"..., 35error: failed to parse /proc/stats ) = 35 munmap(0xbf513000, 4096) = 0 exit_group(1) = ? For RHEL3 fixed in procps-2.0.17-13.1. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-156.html |