From jdrobina@drobina.my.domain  Wed Sep 11 12:23:58 1996
Received: from drobina.my.domain (cmh-p092.infinet.com [206.103.242.98])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id MAA23397
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Sep 1996 12:23:55 -0700 (PDT)
Received: (from jdrobina@localhost) by drobina.my.domain (8.7.5/8.6.12) id PAA00692; Wed, 11 Sep 1996 15:24:03 -0400 (EDT)
Message-Id: <199609111924.PAA00692@drobina.my.domain>
Date: Wed, 11 Sep 1996 15:24:03 -0400 (EDT)
From: jdrobina@infinet.com
Reply-To: jdrobina@infinet.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: panic: locking against myself
X-Send-Pr-Version: 3.2

>Number:         1599
>Category:       kern
>Synopsis:       panic: locking against myself
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 11 12:30:02 PDT 1996
>Closed-Date:    Sun Mar 22 09:30:14 PST 1998
>Last-Modified:  Sun Mar 22 09:31:05 PST 1998
>Originator:     James Drobina
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
None
>Environment:

	
	I have a 90MZ Pentium and a Buslogic 445s SCSI card.
        
	Here is the output ftom dmesg:

	FreeBSD 2.2-CURRENT #2: Wed Sep 11 06:32:55 EDT 1996
	    jdrobina@drobina.my.domain:/home/system/sys/compile/drobina
	Calibrating clock(s) relative to mc146818A clock...
	i586 clock: 90039523 Hz, i8254 clock: 1193273 Hz
	CPU: Pentium (90.03-MHz 586-class CPU)
	  Origin = "GenuineIntel"  Id = 0x524  Stepping=4
	  Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
	real memory  = 50331648 (49152K bytes)
	avail memory = 46473216 (45384K bytes)
	Probing for devices on PCI bus 0:
	chip0 <generic PCI bridge (vendor=1045 device=c822 subclass=0)> rev 1 on pci0:16
	Probing for devices on the ISA bus:
	sc0 at 0x60-0x6f irq 1 on motherboard
	sc0: VGA color <16 virtual consoles, flags=0x0>
	sio0 at 0x3f8-0x3ff irq 4 on isa
	sio0: type 16550A
	sio1 at 0x2f8-0x2ff irq 3 on isa
	sio1: type 16550A
	sio2: disabled, not probed.
	sio3: disabled, not probed.
	lpt0 at 0x378-0x37f irq 7 on isa
	lpt0: Interrupt-driven port
	lp0: TCP/IP capable interface
	pca0 on motherboard
	pca0: PC speaker audio driver
	fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
	fdc0: NEC 765
	fd0: 1.44MB 3.5in
	fd1: 1.2MB 5.25in
	bt0: Bt445S/ 0-(32bit) bus
	bt0: Your card cannot DMA above 16MB boundary. Bounce buffering enabled.
	bt0: reading board settings, busmastering, int=12
	bt0: version 3.37, fast sync, parity, 32 mbxs, 32 ccbs
	bt0: targ 0 sync rate=10.00MB/s(100ns), offset=15
	bt0: targ 1 async
	bt0: targ 2 sync rate=10.00MB/s(100ns), offset=15
	bt0: targ 3 sync rate=10.00MB/s(100ns), offset=08
	bt0: Using Strict Round robin scheme
	bt0 at 0x330 irq 12 on isa
	bt0 waiting for scsi devices to settle
	(bt0:0:0): "MICROP 2217-15MQ1001901 HQ30" type 0 fixed SCSI 2
	sd0(bt0:0:0): Direct-Access 1685MB (3450902 512 byte sectors)
	(bt0:1:0): "ARCHIVE VIPER 150  21247 -011" type 1 removable SCSI 1
	st0(bt0:1:0): Sequential-Access density code 0x0,  drive empty
	(bt0:2:0): "IBM DORS-32160 S82C" type 0 fixed SCSI 2
	sd1(bt0:2:0): Direct-Access 2063MB (4226725 512 byte sectors)
	(bt0:3:0): "TEAC CD-ROM CD-56S 1.0A" type 5 removable SCSI 2
	cd0(bt0:3:0): CD-ROM cd present [326402 x 2048 byte records]
	npx0 on motherboard
	npx0: INT 16 interface
	pas0 at 0x388 irq 5 drq 3 on isa
	pas0: <Pro AudioSpectrum 16D rev 127>

>Description:

My system would reboot while I was grepping some source code on cdrom. 
I could't find and error messages anywhere. 

I re-ran what I thought would trigger the problem from the console. 
These messages were printed on the console: 

panic: locking against myself 

syncing disks... 
>How-To-Repeat:

	(After system reboot.)

	1. login.
        2. mount /cdrom
        3. cd /cdrom/usr/include
        4. fgrep xx *.h

	The error is repeatable.  I was able to repeat it three times.  My
	system seemed to panic at the same place each time.  (The cdrom was the
	FreeBSD 2.1 live file system.)


>Fix:
	
	Unknown

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: scrappy 
State-Changed-When: Tue Oct 22 22:29:10 PDT 1996 
State-Changed-Why:  

Confirm Status:  
State-Changed-From-To: feedback->closed 
State-Changed-By: scrappy 
State-Changed-When: Wed Oct 23 12:53:42 PDT 1996 
State-Changed-Why:  

Problem Still Exists: 

The problen still exists, but I have discovered more information.  If you 
login as root the problen does not occur.  But, if you login in as yourself, 
the su to root the problem occurs. 

I think I missed this fact before because I may have has mount_cd9660 sutuid 
to root. 

This sequence demonstrates the problem. 

1.  login with a non-root id 
2.  su 
3.  mount /cdrom        (The CD is the FreeBSD 2.1R live file system.) 
4.  cd /cdrom/usr/include 
5.  fgrep xx *.h 

panic: locking against myself 

This also shows the problem. 

1.  login with a non-root id 
2.  su 
3.  mount /cdrom 
4.  exit 
5.  cd /cdrom/usr/include 
6.  fgrep xx *.h 

However, if you login as root no error occurs. 

1.  login as root 
2.  mount /cdrom 
3.  cd /cdrom/usr/include 
4.  fgrep xx *.h 

works 

A more stressful test works as well. 

1.  login as root 
2.  mount /cdrom 
3.  cd /cdrom/usr/include 
4.  for i in * ; do 
fgrep xx *.h */*.h 
done 


State-Changed-From-To: closed->open 
State-Changed-By: scrappy 
State-Changed-When: Wed Oct 23 18:43:16 PDT 1996 
State-Changed-Why:  

should have been changed to open, not closed... 


From: Studded <Studded@dal.net>
To: freebsd-gnats-submit@freebsd.org, jdrobina@infinet.com
Cc:  Subject: Re: kern/1599: panic: locking against myself
Date: Sun, 22 Mar 1998 02:52:53 -0800

 Mail to originator fails with "user unknown."
 
 Doug
 -- 
 ***         Chief Operations Officer, DALnet IRC network       ***
 *** Proud operator, designer and maintainer of the world's largest
 *** Internet Relay Chat server.  5,328 clients and still growing.
 *** Try spider.dal.net on ports 6662-4    (Powered by FreeBSD)
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Mar 22 09:30:14 PST 1998 
State-Changed-Why:  
Mail ping to originator failed.  If you are still out there 
and this problem still exists I will re-open this PR. 
>Unformatted:
