From ed0302e6a7fdb11cf0a5f7c0fac2bec64d898e09 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Tue, 23 Mar 2004 08:37:34 +0000 Subject: [PATCH] Do not copy vm_exitingcnt to the new vmspace in vmspace_exec(). Copying it led to impossibly high values in the new vmspace, causing it to never drop to 0 and be freed. --- sys/vm/vm_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index d4a7fe6da75..b5897edf1a3 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2789,7 +2789,8 @@ vmspace_exec(struct proc *p, vm_offset_t minuser, vm_offset_t maxuser) GIANT_REQUIRED; newvmspace = vmspace_alloc(minuser, maxuser); bcopy(&oldvmspace->vm_startcopy, &newvmspace->vm_startcopy, - (caddr_t) (newvmspace + 1) - (caddr_t) &newvmspace->vm_startcopy); + (caddr_t) &newvmspace->vm_endcopy - + (caddr_t) &newvmspace->vm_startcopy); /* * This code is written like this for prototype purposes. The * goal is to avoid running down the vmspace here, but let the