Re: patches to fix "ps -M" as used in crashinfo(8)

From: John Baldwin <jhb_at_freebsd.org>
Date: Wed, 26 Aug 2009 08:44:16 -0400
On Monday 24 August 2009 6:01:45 pm Bruce Cran wrote:
> I've recently been debugging a series of problems with running ps(1) on
> crash dumps, and now have a couple of patches: the bugs cause
> ps(1) to crash while crashinfo(8) is being run during boot, dumping a
> 1GB ps.core file in the root filesystem.
> 
> The patches are at
> http://www.cran.org.uk/~brucec/freebsd/pr137890.kvm_proc.c.diff and
> http://www.cran.org.uk/~brucec/freebsd/pr137890.ps.c.diff
> 
> The problem with ps.c is that like pkill(1) and w(1), they all
> initialize the execfile argument to kvm_open or kvm_openfiles to
> "/dev/null" instead of NULL, causing the default usage of "ps
> -M /var/crash/vmcore.x" to fail because libkvm fails to
> fstat /dev/null. They only work if "-N" is also specified.

Note that crashinfo specifies both -M and -N:

echo "------------------------------------------------------------------------"
echo "ps -axl"
echo
ps -M $VMCORE -N $KERNEL -axl
echo

I'm not sure that 'ps -M blah' without '-N' should really work.  Also, I'm not 
sure how fstat() of /dev/null could fail?

The kvm_nlist() bug in libkvm should probably still be fixed, and the ngroups 
one you might want to poke brooks_at_ about.

-- 
John Baldwin
Received on Wed Aug 26 2009 - 11:32:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:54 UTC