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. There are also two bugs in libkvm: firstly the return code from kvm_nlist wasn't being checked and as a result the code was walking off the end of an array (it assumes kvm_nlist returns a positive number, when it returns -1) - the original patch is at http://people.freebsd.org/~gavin/PRs/137890.2.diff . After the bug in ps.c was fixed it seems that changes to ucred.cr_groups was causing a crash in bcopy. Translating the address using KREAD appears to work, but not being familiar with the kernel interface I don't know if that's the correct solution. -- Bruce CranReceived on Mon Aug 24 2009 - 20:01:52 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:54 UTC