Subject: Re: libkvm programs with different behaviour
To: Stefan Voss <voss@yoda.in-berlin.de>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 12/05/1998 13:59:11
> 
> 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?

netstat is dynamically linked, whereas ps is statically linked.  Are you installing the new libkvm.so?

Richard