Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Mar 1996 01:19:51 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        current@FreeBSD.org, jkh@time.cdrom.com
Subject:   Re: pstat: cannot read swaplist: kvm_read: Bad address
Message-ID:  <199603011419.BAA17909@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I now get this for pstat all the time, and I've recompiled all the
>libs it depends on.

The problem seems to be that /dev/kmem isn't all readable.  Only the
resident parts of it are.  This is enforced by the following code
in the memory driver:

			/*
			 * Make sure that all of the pages are currently resident so
			 * that we don't create any zero-fill pages.
			 */
			addr = trunc_page(uio->uio_offset);
			eaddr = round_page(uio->uio_offset + c);
			for (; addr < eaddr; addr += PAGE_SIZE)
				if (pmap_extract(kernel_pmap, addr) == 0)
					return EFAULT;

The pages that I looked at could be read from kmem after I looked at
them using ddb.  The ones for the swap list seemed to be normal under
ddb.  Apparently looking at them right faults them in.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603011419.BAA17909>