Subject: Re: Neat. I broke top and ps.
To: None <port-macppc@netbsd.org>
From: gabriel rosenkoetter <gr@eclipsed.net>
List: port-macppc
Date: 11/30/1999 18:43:04
On Sun, Nov 28, 1999 at 10:25:36AM +0900, ?$BF#86?(B  ?$B@??(B Makoto Fujiwara wrote:
> gr> uriel:~% ps ajx                               
> gr> ps: proc size mismatch (25056 total, 680 chunks).
> gr> ps: statfs on /proc failed: No such file or directory
> gr> ps: fallback /proc-based lookup also failed.  Giving up...
> I think you need to compile ps,top,w with the libkvm which
> is used to compile your -current kernel.
[...]
> I found the answer in
> http://www.netbsd.org/Documentation/misc/
> where starting the line, either following lines.
> ------------------------
> w, ps, and netstat do not work after upgrading to a new kernel (top)
> ------------------------
> After changing kernels, 'ps' reports "proc size mismatch" (top)

Yeah, I would have found that had I done a little research.

::sigh::

Not that that really fixes my problem, though, as:

uriel:usr.bin/top# pwd
/usr/src/usr.bin/top
uriel:usr.bin/top# make
awk -f /usr/src/usr.bin/top/sigconv.awk /usr/include/sys/signal.h >
sigdesc.h
cc -O  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror   -I/usr/src/usr.bin/top -I. -DORDER -DHAVE_STRERROR -c top.c
cc -O  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror   -I/usr/src/usr.bin/top -I. -DORDER -DHAVE_STRERROR -c commands.c
cc -O  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror   -I/usr/src/usr.bin/top -I. -DORDER -DHAVE_STRERROR -c display.c
cc1: warnings being treated as errors
display.c: In function `u_loadave':
display.c:217: warning: passing arg 3 of `tputs' from incompatible pointer type
[repeatedly, in various functios, same miscalling]
*** Error code 1

Stop.

... which sends me to /usr/include to rebuild, where I find:

uriel:src/include# pwd
/usr/src/include
uriel:src/include# make
"Makefile", line 5: Could not find bsd.crypto.mk
Fatal errors encountered -- cannot continue

(... the theory here being to install the includes that go with the
kernel snapshot I'm using.)

Now I'm up against the "where the hell do we keep secr.tgz again?"
problem... and I cannot, for the life of me, find it anywhere on
ftp.netbsd.org. (Would someone please put this in a FAQ somewhere?
Please?)

For the time being, I comment out the bsd.crypto.mk sourcing, do a
make includes in /usr/src/includes, and find that top still complains
the same way. Okay, maybe that didn't make the sys includes... and it
sure hasn't updated /usr/include/kvm.h (not that it should need
updating anyway):

uriel:src/include# ll kvm.h
-rw-------  1 root  wheel  3074 Apr 20  1996 kvm.h
uriel:src/include# ll /usr/include/kvm.h
-r--r--r--  1 root  wheel  3074 Jul 18 16:01 /usr/include/kvm.h
uriel:src/include# diff kvm.h /usr/include/kvm.h
uriel:src/include# 

So I return for round 3, discovering the readily evident
/usr/src/lib/libkvm. Duh. So I make and install that only to find
that... top STILL won't compile! Yeah!

In addition, w, netstat, and ps builds die with similar errors:

...
[w]
cc1: warnings being treated as errors
w.c: In function `main':
w.c:213: warning: null format string
*** Error code 1
...
[netstat]
cc1: warnings being treated as errors
if.c:74: warning: `struct in6_addr' declared inside parameter list
if.c:74: warning: its scope is only this definition or declaration,
if.c:74: warning: which is probably not what you want.
if.c:75: `INET6_ADDRSTRLEN' undeclared here (not in a function)
if.c: In function `intpr':
if.c:93: field `in6' has incomplete type
if.c:224: dereferencing pointer to incomplete type
if.c: At top level:
if.c:75: warning: `ntop_buf' defined but not used
*** Error code 1
...
[ps]
cc1: warnings being treated as errors
keyword.c: In function `parsefmt':
keyword.c:229: warning: null format string
*** Error code 1

Two things bother me here:

1) I'm not using ipv6. I don't want to be. I was under the impression
my kernel and, hence, my build environment knew this.

2) Why is cc treating warnings as errors? Is that an intentional
feature of NetBSD src Makefiles? Why?

Just for good measure, I'm getting lib.tar.gz from
ftp.netbsd.org:/pub/NetBSD/NetBSD-current/tar_files/src again, but I'm
certain I've already got a current version and that isn't the problem.

This has gotten wonky enough that I'm afraid of munging something
quasi-permanently if I keep hacking on blindly through the brush, so
I'm going to step back and see if someone here can't tell me the
blatantly silly errors I'm making.

       ~ g r @ eclipsed.net