Subject: kern/960: pmap_init bug crashes kernel
To: None <gnats-admin@NetBSD.ORG>
From: None <ghudson@MIT.EDU>
List: netbsd-bugs
Date: 04/11/1995 18:50:03
>Number:         960
>Category:       kern
>Synopsis:       Kernel crashes in pmap_init() for certain defines.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 11 18:50:01 1995
>Originator:     Greg Hudson
>Organization:
	MIT SIPB
>Release:        March 10, but mycroft may have made some local changes
>Environment:
System: NetBSD glacier 1.0A NetBSD 1.0A (GLACIER) #2: Mon Mar 20 21:04:26 EST 1995 ghudson@glacier:/usr/src/sys/arch/i386/compile/GLACIER i386


>Description:
	By accident, I miscapitalized VNODEPAGER in my kernel config
	file, so it was undefined.  pmap_init() crashes (rebooting the
	machine) in this case, because its for loop does not properly
	detect a NULL entry in pagertab.
>How-To-Repeat:
	Build a kernel without SWAPPAGER, VNODEPAGER, or DEVPAGER, and
	boot it.
>Fix:
	This fix is untested, but I think is pretty obviously correct.

*** vm_pager.c	Thu Mar  9 04:43:15 1995
--- vm_pager.c.fix	Tue Apr 11 21:45:21 1995
***************
*** 138,144 ****
  	 * Initialize known pagers
  	 */
  	for (pgops = pagertab; pgops < &pagertab[npagers]; pgops++)
! 		if (pgops)
  			(*(*pgops)->pgo_init)();
  	if (dfltpagerops == NULL)
  		panic("no default pager");
--- 138,144 ----
  	 * Initialize known pagers
  	 */
  	for (pgops = pagertab; pgops < &pagertab[npagers]; pgops++)
! 		if (*pgops)
  			(*(*pgops)->pgo_init)();
  	if (dfltpagerops == NULL)
  		panic("no default pager");
>Audit-Trail:
>Unformatted:


		since then (this is SIPB's source tree in
		/mit/netbsd/dev/current-source at MIT).