[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#344546: incomplete /proc/<pid>/stat breaks killall5



Package: kfreebsd-5
Severity: important

The fields startcode and endcode in /proc/<pid>/stat are hardcoded to "0", both
for normal processes and "kernel" processes (or whatever you want to call them).

killall5 (sysvinit) uses these values to determine wether a process belongs to
kernel.  When both startcode and endcode are 0, then it's a kernel one.  So on
GNU/kFreeBSD, it thinks _every_ process is a kernel process.

As a consequence, it won't kill anything.  So any mounted filesystems (including
the root fs) will fail to umount, causing occasional filesystem corruption.

I'm not sure how to fix this properly.  I've tried hardcoding "endcode" to
(unsigned)-1, the result being that when killall5 is called, you lost your
system.  It can be either:
  - Because it "killed" a critical kernel process.
  - Because it killed the shell I was running and/or init.

For now I'll send a patch to sysvinit maintainers asking to pass "-f" to umount.
This is not the proper fix, but I think it's reasonable to use -f anyway, just
in case.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)



Reply to: