Subject: Re: systat(:swap) misbehaving
To: None <e.p.boven@student.utwente.nl>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-sparc
Date: 01/22/1997 15:15:14
On Tue, 21 Jan 1997 03:33:30 +0100 (CET) 
 e.p.boven@student.utwente.nl (Paul Boven) wrote:

 > While compiling something large I was using systat to monitor the use
 > of virtual memory by looking at the :swap display. Alas, in this mode
 > systat never really lives very long, exciting with SIGSEGV's for instance.
 > Usually this is preceded by a "cannot read swapmap: kwm_read: Bad address"
 > generated in fetchswap(). "Uptime" for systat is rarely more than 10
 > minutes while compiling, it seems to last longer when swap isn't being
 > used so heavily. I compiled systat (current sources and includes, current 
 > kernel) with -g, and here is the output from gdb:

...what's probably happening is that the kernel state is changing at
such a rapid pace that the userland program is reading info which
is immediately out-of-date... when it goes it get the next piece, it
may not be there.

Programs that grovel kvm state like this could probably use some extra
sanity checking in them.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939