What about something like this. If the vm_refcnt is still being decremented too early, could it be moved to just before the thread_exit() call? -Matt
Index: kern/kern_exit.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_exit.c,v retrieving revision 1.187 diff -u -r1.187 kern_exit.c --- kern/kern_exit.c 10 Dec 2002 02:33:44 -0000 1.187 +++ kern/kern_exit.c 15 Dec 2002 01:08:21 -0000 @@ -288,7 +288,7 @@ * Can't free the entire vmspace as the kernel stack * may be mapped within that space also. */ - if (--vm->vm_refcnt == 0) { + if (vm->vm_refcnt == 1) { if (vm->vm_shm) shmexit(p); vm_page_lock_queues(); @@ -298,7 +298,9 @@ (void) vm_map_remove(&vm->vm_map, vm_map_min(&vm->vm_map), vm_map_max(&vm->vm_map)); vm->vm_freer = p; + KASSERT(vm->vm_refcnt == 1, ("expected vm_refcnt of 1")); } + --vm->vm_refcnt; sx_xlock(&proctree_lock); if (SESS_LEADER(p)) { To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message