From sysseh@devetir.qld.gov.au  Tue Apr  1 15:17:32 1997
Received: from bunyip.cc.uq.edu.au (daemon@bunyip.cc.uq.edu.au [130.102.2.1])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA11619
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 1 Apr 1997 15:17:30 -0800 (PST)
Received: (from daemon@localhost)
	by bunyip.cc.uq.edu.au (8.8.5/8.8.5) id JAA24200;
	Wed, 2 Apr 1997 09:17:27 +1000
Received: from maya.devetir.qld.gov.au by ogre.dtir.qld.gov.au (8.7.5/DEVETIR-E0.3a) with ESMTP
	id JAA01349; Wed, 2 Apr 1997 09:13:43 +1000 (EST)
Received: from netfl15a.devetir.qld.gov.au (netfl15a.devetir.qld.gov.au [167.123.24.12])
	by maya.devetir.qld.gov.au (8.8.5/8.8.5) with SMTP id JAA02760;
	Wed, 2 Apr 1997 09:09:09 +1000 (EST)
Received: from localhost by netfl15a.devetir.qld.gov.au (8.6.8.1/DEVETIR-0.1)
	id XAA21873; Tue, 1 Apr 1997 23:12:39 GMT
Message-Id: <199704012312.XAA21873@netfl15a.devetir.qld.gov.au>
Date: Wed, 02 Apr 1997 09:12:36 +1000
From: Stephen Hocking <sysseh@devetir.qld.gov.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc: toor@dyson.iquest.net
Subject: Panic: lockmgr: locking against myself

>Number:         3168
>Category:       kern
>Synopsis:       Machine crashes when starting X or xdm
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr  1 15:20:02 PST 1997
>Closed-Date:    Thu Apr 3 17:32:20 PST 1997
>Last-Modified:  Thu Apr  3 17:32:54 PST 1997
>Originator:     S Hocking
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Only occasional
>Environment:

	ctm src-cur 2828, started at src-cur 2827

	Copyright (c) 1992-1997 FreeBSD Inc.
	Copyright (c) 1982, 1986, 1989, 1991, 1993
		The Regents of the University of California. All rights reserved.
	FreeBSD 3.0-CURRENT #0: Wed Apr  2 08:26:57 EST 1997
	    toor@priapus.devetir.qld.gov.au:/usr/src/sys/compile/priapus
	CPU: AMD Unknown (486-class CPU)
	  Origin = "AuthenticAMD"  Id = 0x494  Stepping=4
	  Features=0x1<FPU>
	real memory  = 25165824 (24576K bytes)
	avail memory = 22388736 (21864K bytes)
	bdevsw_add_generic: adding D_DISK flag for device 15
	Probing for devices on PCI bus 0:
	chip0 <Host to PCI bridge (vendor=10b9 device=1489)> rev 0 on pci0:0:0
	vga0 <VGA-compatible display device> rev 84 int a irq 9 on pci0:5:0
	Probing for devices on the ISA bus:
	sc0 at 0x60-0x6f irq 1 on motherboard
	sc0: VGA color <16 virtual consoles, flags=0x0>
	ed0 at 0x280-0x29f irq 10 maddr 0xd8000 msize 8192 on isa
	ed0: address 00:00:c0:44:73:ec, type SMC8416T (16 bit) 
	lpt0 at 0x378-0x37f irq 7 on isa
	lpt0: Interrupt-driven port
	lp0: TCP/IP capable interface
	sio0 at 0x3f8-0x3ff irq 4 on isa
	sio0: type 16550A
	sio1 at 0x2f8-0x2ff irq 3 on isa
	sio1: type 16550A
	pca0 on isa
	pca0: PC speaker audio driver
	wdc0 at 0x1f0-0x1f7 irq 14 flags 0x80ff80ff on isa
	wdc0: unit 0 (wd0): <SAMSUNG SHD-3212A (APOLLO-4) AD>, 32-bit, multi-block-16
	wd0: 407MB (833664 sectors), 1002 cyls, 16 heads, 52 S/T, 512 B/S
	wdc0: unit 1 (wd1): <Conner Peripherals 850MB - CFA850A>, 32-bit, multi-block-32
	wd1: 813MB (1665216 sectors), 1652 cyls, 16 heads, 63 S/T, 512 B/S
	aha0 at 0x330-0x333 irq 11 drq 6 on isa
	scbus0 at aha0 bus 0
	sd0 at scbus0 target 0 lun 0
	sd0: <MICROP 1684-07MB1036511 AS0C> type 0 fixed SCSI 1
	sd0: Direct-Access 323MB (663476 512 byte sectors)
	cd0 at scbus0 target 2 lun 0
	cd0: <PIONEER CD-ROM DR-124X 1.00> type 5 removable SCSI 2
	cd0: CD-ROM can't get the size
	st0 at scbus0 target 4 lun 0
	st0: <WANGTEK 51000  SCSI RVM7 5F5> type 1 removable SCSI 1
	st0: Sequential-Access density code 0x0,  drive empty
	fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
	fdc0: NEC 765
	fd0: 1.44MB 3.5in
	npx0 on motherboard
	npx0: INT 16 interface

>Description:

	Machine panics with "lockmgr: locking against myself"

	Backtrace as follows -

	#0  0xf010e73e in boot ()
	#1  0xf010ea2a in panic ()
	#2  0xf0109a87 in lockmgr ()
	#3  0xf01af0f1 in ufs_lock ()
	#4  0xf0136bb4 in vn_lock ()
	#5  0xf0130c5b in vputrele ()
	#6  0xf0130cbe in vrele ()
	#7  0xf01be229 in vnode_pager_dealloc ()
	#8  0xf01bd5a6 in vm_pager_deallocate ()
	#9  0xf01b8e27 in vm_object_terminate ()
	#10 0xf01b8c27 in vm_object_deallocate ()
	#11 0xf0130b70 in vputrele ()
	#12 0xf0130cbe in vrele ()
	#13 0xf0106b8b in execve ()
	#14 0xf01c9ec6 in syscall ()
	#15 0x813ae71 in ?? ()
	#16 0x1920 in ?? ()
	#17 0x22ad in ?? ()
	#18 0x1d97 in ?? ()
	#19 0x1096 in ?? () 

>How-To-Repeat:

	Use startx to start the Xserver, or have the Xserver started by xdm.
>Fix:
	
	Unknown. (Why can't a process lock the same region repeatedly?)


-- 
  The views expressed above are not those of WorkCover Queensland, Australia.

    "We've heard that a million monkeys at a million keyboards could produce
     the Complete Works of Shakespeare; now, thanks to the Internet, we know
     this is not true."            Robert Wilensky, University of California


>Release-Note:
>Audit-Trail:

From: Tor Egge <Tor.Egge@idi.ntnu.no>
To: sysseh@devetir.qld.gov.au
Cc: FreeBSD-gnats-submit@freebsd.org, toor@dyson.iquest.net
Subject: Re: kern/3168: Panic: lockmgr: locking against myself
Date: Fri, 04 Apr 1997 02:42:38 +0200

 > 
 > >Number:         3168
 > >Category:       kern
 > >Synopsis:       Machine crashes when starting X or xdm
 
 I got a similar crash (same stack trace).
 
 How-To-Repeat:
 
 	rm -f bad
 	touch bad
 	chmod 755 bad
 	./bad
 
 Fix:
 
 Index: kern_exec.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/kern/kern_exec.c,v
 retrieving revision 1.53
 diff -c -r1.53 kern_exec.c
 *** kern_exec.c	1997/03/31 11:10:55	1.53
 --- kern_exec.c	1997/04/04 00:09:11
 ***************
 *** 160,167 ****
   	 */
   	error = exec_check_permissions(imgp);
   
 ! 	if (error)
   		goto exec_fail_dealloc;
   
   	/*
   	 * Get the image header, which we define here as meaning the first
 --- 160,169 ----
   	 */
   	error = exec_check_permissions(imgp);
   
 ! 	if (error) {
 ! 		VOP_UNLOCK(imgp->vp, 0, p);
   		goto exec_fail_dealloc;
 + 	}
   
   	/*
   	 * Get the image header, which we define here as meaning the first
 
 
State-Changed-From-To: open->closed 
State-Changed-By: davidg 
State-Changed-When: Thu Apr 3 17:32:20 PST 1997 
State-Changed-Why:  

The suggested patch was applied, thanks! 
>Unformatted:
