Subject: Re: kern/31391: panic: uvm_lwp_fork: uvm_fault_wire failed: 14
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 11/07/2005 08:00:04
The following reply was made to PR kern/31391; it has been noted by GNATS.

From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/31391: panic: uvm_lwp_fork: uvm_fault_wire failed: 14
Date: Mon, 07 Nov 2005 16:58:24 +0900

 > >Number:         31391
 > >Category:       kern
 > >Synopsis:       panic: uvm_lwp_fork: uvm_fault_wire failed: 14
 
 > newlwp(fb02b114,fd187808,c0000000,0,0) at netbsd:newlwp+0xc4
 
 i guess that this c0000000 is due to a bug in uvm_km_valloc1.
 maybe it's better to make uvm_uarea_alloc() do waitok allocation.
 
 YAMAMOTO Takashi
 
 Index: uvm_km.c
 ===================================================================
 RCS file: /cvsroot/src/sys/uvm/uvm_km.c,v
 retrieving revision 1.77
 diff -u -p -r1.77 uvm_km.c
 --- uvm_km.c	26 Feb 2005 22:31:44 -0000	1.77
 +++ uvm_km.c	7 Nov 2005 07:49:06 -0000
 @@ -763,6 +763,10 @@ uvm_km_valloc1(map, size, align, prefer,
  
  	KASSERT(error == 0 || (flags & UVM_KMF_NOWAIT) != 0);
  
 +	if (error) {
 +		return 0;
 +	}
 +
  	UVMHIST_LOG(maphist,"<- done (kva=0x%x)", kva,0,0,0);
  
  	return (kva);
 Index: uvm_glue.c
 ===================================================================
 RCS file: /cvsroot/src/sys/uvm/uvm_glue.c,v
 retrieving revision 1.83.4.2
 diff -u -p -r1.83.4.2 uvm_glue.c
 --- uvm_glue.c	28 Oct 2005 19:49:21 -0000	1.83.4.2
 +++ uvm_glue.c	7 Nov 2005 07:49:06 -0000
 @@ -319,7 +319,8 @@ uvm_uarea_alloc(vaddr_t *uaddrp)
  		return TRUE;
  	} else {
  		simple_unlock(&uvm_uareas_slock);
 -		*uaddrp = uvm_km_valloc_align(kernel_map, USPACE, USPACE_ALIGN);
 +		*uaddrp = uvm_km_valloc1(kernel_map, USPACE, USPACE_ALIGN,
 +		    UVM_UNKNOWN_OFFSET, 0);
  		return FALSE;
  	}
  }