Properly initialize the new vmspace and register its pmap.
authorSimon Schubert <corecode@dragonflybsd.org>
Tue, 6 Jan 2009 02:18:30 +0000 (03:18 +0100)
committerSimon Schubert <corecode@dragonflybsd.org>
Tue, 6 Jan 2009 02:57:18 +0000 (03:57 +0100)
Without this the vmspace's pmap would not be in the global
pmap_list.  This later leads to a panic when sys_exec_sys_unregister
releases the vmspace.

Reported-by: Christian Sturm <athaba@inode.at>
sys/kern/imgact_resident.c

index 0107c55..6389c0e 100644 (file)
@@ -212,6 +212,7 @@ sys_exec_sys_register(struct exec_sys_register_args *uap)
     vmres->vr_id = ++exec_res_id;
     vmres->vr_entry_addr = (intptr_t)uap->entry;
     vmres->vr_vmspace = vmspace_fork(p->p_vmspace); /* XXX order */
+    pmap_pinit2(vmspace_pmap(vmres->vr_vmspace));
 
     lockmgr(&exec_list_lock, LK_EXCLUSIVE);
     TAILQ_INSERT_TAIL(&exec_res_list, vmres, vr_link);