Subject: infinite loop in uvm_map_clean() ?
To: None <tech-kern@netbsd.org>
From: None <k-abe@cs.utah.edu>
List: tech-kern
Date: 01/12/2001 20:13:30
Hi,
It seems that uvm_map_clean() might fall into infinite loop.
I'm not sure whether this bug shows up in the NetBSD world because
I'm just playing with UVM..
A fix is something like:
*** /home/k-abe/NetBSD/syssrc/sys/uvm/uvm_map.c Mon Nov 27 01:40:03 2000
--- ../netbsd/src/sys/uvm/uvm_map.c Fri Jan 12 18:16:58 2001
***************
*** 2474,2480 ****
* Make a first pass to check for holes.
*/
! for (current = entry; current->start < end; current = current->next) {
if (UVM_ET_ISSUBMAP(current)) {
vm_map_unlock_read(map);
return (KERN_INVALID_ARGUMENT);
--- 2481,2491 ----
* Make a first pass to check for holes.
*/
! for (current = entry;
! #ifdef OSKIT
! (current != &map->header) &&
! #endif
! current->start < end; current = current->next) {
if (UVM_ET_ISSUBMAP(current)) {
vm_map_unlock_read(map);
return (KERN_INVALID_ARGUMENT);
***************
*** 2488,2494 ****
error = KERN_SUCCESS;
! for (current = entry; current->start < end; current = current->next) {
amap = current->aref.ar_amap; /* top layer */
uobj = current->object.uvm_obj; /* bottom layer */
KASSERT(start >= current->start);
--- 2499,2509 ----
error = KERN_SUCCESS;
! for (current = entry;
! #ifdef OSKIT
! (current != &map->header) &&
! #endif
! current->start < end; current = current->next) {
amap = current->aref.ar_amap; /* top layer */
uobj = current->object.uvm_obj; /* bottom layer */
KASSERT(start >= current->start);
--
Kota Abe
Dept. of Computer Science, Univ. of Utah.
Media Center, Osaka City Univ.