From owner-freebsd-current Sun May 20 13:29:41 2001 Delivered-To: freebsd-current@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id B3E1F37B424; Sun, 20 May 2001 13:29:34 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from spike.unixfreak.org (spike [63.198.170.139]) by bazooka.unixfreak.org (Postfix) with ESMTP id 847EB3E0B; Sun, 20 May 2001 13:29:33 -0700 (PDT) To: David Malone Cc: mheffner@vt.edu, freebsd-current@freebsd.org, alfred@freebsd.org Subject: Re: panic: mutex vm not owned In-Reply-To: <20010520205211.A88802@walton.maths.tcd.ie>; from dwmalone@maths.tcd.ie on "Sun, 20 May 2001 20:52:11 +0100" Date: Sun, 20 May 2001 13:29:22 -0700 From: Dima Dorfman Message-Id: <20010520202933.847EB3E0B@bazooka.unixfreak.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG David Malone writes: > On Sun, May 20, 2001 at 12:59:51PM -0400, Mike Heffner wrote: > > The machine is up for about one minute and then I ran `startx' and the > > screen turned black and it appeared to lockup, after about 30 seconds > > plus some banging on the keyboard it rebooted. I have 256mb ram, so it > > shouldn't be swapping at this point. The kernel and world are cvsupd > > to about 12am May 20 EDT, the following is the panic message: > > I'm getting a panic whenever I start X too (with a kernel from > earlier today). I managed to get a DDB trace from a serial console. Please try the attached patch. I make no claims of its correctness, but this e-mail is coming to you via X on -current updated a few hours ago so it works here :-). I had to manually edit out some unrelated local changes, so if you have trouble applying it fetch the full one from http://www.unixfreak.org/~dima/home/shm-full.diff. That one has local changes (new sysctls), but they (probably) won't hurt you. Thanks, Dima Dorfman dima@unixfreak.org Index: sysv_shm.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/kern/sysv_shm.c,v retrieving revision 1.56 diff -u -r1.56 sysv_shm.c --- sysv_shm.c 2001/05/19 01:28:03 1.56 +++ sysv_shm.c 2001/05/20 20:26:28 @@ -182,7 +186,9 @@ size_t size; shm_handle = shmseg->shm_internal; + mtx_lock(&vm_mtx); vm_object_deallocate(shm_handle->shm_object); + mtx_unlock(&vm_mtx); free((caddr_t)shm_handle, M_SHM); shmseg->shm_internal = NULL; size = round_page(shmseg->shm_segsz); @@ -203,7 +209,9 @@ segnum = IPCID_TO_IX(shmmap_s->shmid); shmseg = &shmsegs[segnum]; size = round_page(shmseg->shm_segsz); + mtx_lock(&vm_mtx); result = vm_map_remove(&p->p_vmspace->vm_map, shmmap_s->va, shmmap_s->va + size); + mtx_unlock(&vm_mtx); if (result != KERN_SUCCESS) return EINVAL; shmmap_s->shmid = -1; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message