Subject: sysctl failing on NetBSD-2.0.1
To: None <current-users@netbsd.org>
From: Feico Dillema <feico@pasta.cs.uit.no>
List: current-users
Date: 03/10/2005 14:58:48
Is some kernel datastructure overflowing in the last one? All 3
(i386) machines run a fairly recent 2.0.1 kernel, and the main
difference is the setting of maxvnodes which is high on the 3rd
one below.

When running pstat in gdb it seems that the sysctl does not at all
write a value to its argument, such that an uninitialized variable is
subsequently passed to malloc() causing it to fail. Is this a bug
or is there some limit to how high kern.maxvnodes may be set?

Feico.

# uname -v
NetBSD 2.0.1 () #12: Wed Feb  2 10:11:38 CET 2005  
# pstat -T
 30/10000 files
  19999 vnodes
216/262144 blocks swap space

# uname -v
NetBSD 2.0.1 () #0: Sun Jan 30 22:14:02 CET 2005
#pstat -T
185/1772 files
   8156 vnodes
5408/263088 blocks swap space

# uname -v
NetBSD 2.0.1 () #1: Sat Feb 19 15:53:35 CET 2005 
# pstat -T
149/10000 files
pstat: malloc: Cannot allocate memory
# pstat -v
pstat: malloc: Cannot allocate memory
# sysctl kern.maxvnodes
kern.maxvnodes = 1048576