Apply by doing:
	cd /usr/src
	patch -p0 < 015_sysvshm.patch

And then rebuild your kernel.

Index: sys/kern/sysv_shm.c
===================================================================
RCS file: /cvs/src/sys/kern/sysv_shm.c,v
retrieving revision 1.33
diff -u -r1.33 sysv_shm.c
--- sys/kern/sysv_shm.c	7 Jan 2003 00:34:41 -0000	1.33
+++ sys/kern/sysv_shm.c	5 Feb 2004 21:36:31 -0000
@@ -281,8 +281,10 @@
 	error = uvm_map(&p->p_vmspace->vm_map, &attach_va, size,
 	    shm_handle->shm_object, 0, 0, UVM_MAPFLAG(prot, prot,
 	    UVM_INH_SHARE, UVM_ADV_RANDOM, 0));
-	if (error)
+	if (error) {
+		uao_detach(shm_handle->shm_object);
 		return (error);
+	}
 
 	shmmap_s->va = attach_va;
 	shmmap_s->shmid = SCARG(uap, shmid);
