From: [EMAIL PROTECTED]
Subject: ps and other utils don't show processes with high PIDs.
Package: procps
Version: 1:3.2.7-6
Severity: normal
Tags: patch
X-Debbugs-CC: [EMAIL PROTECTED]

ps and the other procps utilities don't show processes with
high PIDs.

To reproduce, on x86_64, as root:

  echo 4194304 > /proc/sys/kernel/pid_max

Create a bunch of processes until "ls /proc" shows pid numbers
above approximately 100000.

At that point, 'ps aux' and similar won't show those processes.
(I didn't attempt to determine the exact cutoff, but IIRC it was
a bit below 100k.)

What's going on is that readproc.c calls readdir, which calls
__getdents.  __getdents has to downconvert from the kernel ino_t
to the userland ino_t, which results in EOVERFLOW.  (The entries
for high PIDs get values that won't fit into the 32-bit ino_t.)

I observed this originally in procps 3.2.6-2ubuntu4 (the
dependencies, etc., for that are shown in the system info below),
but reproduced it in a freshly build copy of clean 3.2.7-6 source
downloaded from debian.org.

The change is to add -D_FILE_OFFSET_BITS=64 to the build flags.
I *believe* (but am not sure) that this would be a reasonable
change for all architectures.

The patch to fix this (to be applied after all 3.2.7-6 patches
have been applied) is included below.


-- System Information:
Debian Release: testing/unstable
  APT prefers dapper-updates
  APT policy: (500, 'dapper-updates'), (500, 'dapper-security'), (500, 'dapper')
Architecture: i386 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18.5
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages procps depends on:
ii  libc6                2.3.6-0ubuntu20     GNU C Library: Shared libraries an
ii  libncurses5          5.5-1ubuntu3        Shared libraries for terminal hand
ii  lsb-base             3.1-5ubuntu2        Linux Standard Base 3.1 init scrip

Versions of packages procps recommends:
ii  psmisc                        22.1-1     Utilities that use the proc filesy

-- debconf-show failed

*** /tmp/procps-high-pids.patch
diff -up -r procps-3.2.7-6.CLEAN/Makefile procps-3.2.7-6/Makefile
--- procps-3.2.7-6.CLEAN/Makefile       2008-03-05 19:25:23.000000000 -0800
+++ procps-3.2.7-6/Makefile     2008-03-05 19:32:07.000000000 -0800
@@ -81,7 +81,7 @@ CURSES := -lncurses
 #endif
 
 # Preprocessor flags.
-PKG_CPPFLAGS := -D_GNU_SOURCE -I proc
+PKG_CPPFLAGS := -D_GNU_SOURCE -I proc -D_FILE_OFFSET_BITS=64
 CPPFLAGS     := -I/usr/include/ncurses
 ALL_CPPFLAGS := $(PKG_CPPFLAGS) $(CPPFLAGS)
 



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to