Do not free the vmspace until p->p_vmspace is set to null. Otherwise

statclock can access it in the tail end of statclock_process() at an
unfortunate time.  This bit me several times on an SMP alpha (UP2000)
and the problem went away with this change.  I'm not sure why it doesn't
break x86 as well.  Maybe it's because the clocks are much faster
on alpha (HZ=1024 by default).
This commit is contained in:
peter 2002-04-17 05:26:42 +00:00
parent 1642fd3abc
commit 7af4726714

View File

@ -310,10 +310,14 @@ vmspace_free(struct vmspace *vm)
void
vmspace_exitfree(struct proc *p)
{
GIANT_REQUIRED;
struct vmspace *vm;
if (p == p->p_vmspace->vm_freer)
vmspace_dofree(p->p_vmspace);
GIANT_REQUIRED;
if (p == p->p_vmspace->vm_freer) {
vm = p->p_vmspace;
p->p_vmspace = NULL;
vmspace_dofree(vm);
}
}
/*