Subject: libkvm programs with different behaviour
To: None <port-arm32@netbsd.org>
From: Stefan Voss <voss@yoda.in-berlin.de>
List: port-arm32
Date: 12/05/1998 14:53:44
Hi folks,

since I follow NetBSD-current (at least kernels) it happens to me that
programs like ps, netstat, top, ... refuse to work after a kernel
upgrade. This is no longer a surprise because these programs use
libkvm to access kernel memory so it has become a habit to also follow
libkvm-current and rebuild it frequently. Normally rebuilding libkvm
(and also doing 'make includes' in /usr/src/sys) makes these kvm
programs work again. 

But since a few weeks the kvm programs don't behave the same. E.g. at
the moment I have a working 'ps' binary that I built from current but
'netstat' (also built from current) refuses to work. The kvm programs
that refuse to work all fail at the point when they call kvm_open() or
kvm_openfiles():

voss@yoda:/home/voss > netstat -rn
netstat: $NetBSD: kvm.c,v 1.62 1998/09/27 18:15:58 christos Exp
$$NetBSD: kvm.c,v 1.62 1998/09/27 18:15:58 christos Exp $
$NetBSD: kvm.c,v 1.62 1998/09/27 18:15:58 christos Exp $$NetBSD:
kvm.c,v 1.62 1998/09/27 18:15:58 christos Exp $$NetBSD: kvm.c,v 1.62
1998/09/27 18:15:58 christ

voss@yoda:/home/voss > ps
  PID TT  STAT      TIME COMMAND
  151 v0  Is     0:01.98 -bash 
 4820 v0  I+     0:00.08 /bin/sh /usr/X11R6/bin/startx 
 4825 v0  I+     0:00.31 xinit /home/voss/.xinitrc -- 
 4826 v0  S      3:01.63 X :0 (Xarm-34)
 ...


I compared the code of 'ps' and 'netstat'. Both use kvm_openfiles()
with the same parameters. 'ps' works ok but 'netstat' does not.

Can somebody give me a hint why these two programs behave differently
despite using the same code?

Regards,
   Stefan

-- 
Stefan Voss
(voss@yoda.in-berlin.de)