OpenBSD 5.2-current - panic: mtx_enter: locking against myself

2012-09-12 Thread Maxim Bourmistrov
Hi,

I'm getting panic: mtx_enter: locking against myself on not so
-current OpenBSD 5.2-current (snapshot).

Machine is not dropping into ddb even if sysctl.conf says it should.
Console is filled with panic: mtx_enter: locking against myself
and seems to loop.

OpenBSD 5.2-current (GENERIC.MP) #378: Mon Aug 20 12:55:12 MDT 2012
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4284039168 (4085MB)
avail mem = 4147576832 (3955MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xeadc0 (105 entries)
bios0: vendor American Megatrends Inc. version 4.6.4 date 06/30/2011
bios0: Supermicro X9SCL/X9SCM
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP APIC SSDT MCFG HPET SPMI EINJ ERST HEST BERT
acpi0: wakeup devices PS2K(S1) PS2M(S1) UAR1(S4) UAR2(S4) BR20(S1)
EUSB(S4) USBE(S4) PEX0(S4) PEX4(S4) PEX6(S4) GBE_(S4) P0P1(S4) P0P2(S4)
P0P3(S4) P0P4(S4) SLPB(S0) PWRB(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz, 2195.30 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: apic clock running at 99MHz
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz, 2195.02 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu1: 256KB 64b/line 8-way L2 cache
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz, 2195.02 MHz
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu2: 256KB 64b/line 8-way L2 cache
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz, 2195.02 MHz
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu3: 256KB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 0 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 7 (BR20)
acpiprt2 at acpi0: bus 5 (PEX0)
acpiprt3 at acpi0: bus 6 (PEX4)
acpiprt4 at acpi0: bus -1 (PEX6)
acpiprt5 at acpi0: bus 1 (P0P1)
acpiprt6 at acpi0: bus 2 (P0P2)
acpiprt7 at acpi0: bus -1 (P0P3)
acpiprt8 at acpi0: bus -1 (P0P4)
acpicpu0 at acpi0: C3, C1, PSS
acpicpu1 at acpi0: C3, C1, PSS
acpicpu2 at acpi0: C3, C1, PSS
acpicpu3 at acpi0: C3, C1, PSS
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: PWRB
ipmi at mainbus0 not configured
cpu0: Enhanced SpeedStep 2195 MHz: speeds: 2201, 2200, 2100, 2000, 1900,
1800, 1700, 1600 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel Xeon E3-1200 Host rev 0x09
ppb0 at pci0 dev 1 function 0 Intel Core 2G PCIE rev 0x09: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 1 function 1 Intel Core 2G PCIE rev 0x09: msi
pci2 at ppb1 bus 2
ppb2 at pci2 dev 0 function 0 Intel 41210 PCIE-PCIX rev 0x09
pci3 at ppb2 bus 3
bnx0 at pci3 dev 4 function 0 Broadcom BCM5706 rev 0x02: apic 0 int 17
ppb3 at pci2 dev 0 function 2 Intel 41210 PCIE-PCIX rev 0x09
pci4 at ppb3 bus 4
bnx1 at pci4 dev 5 function 0 Broadcom BCM5706 rev 0x02: apic 0 int 18
em0 at pci0 dev 25 function 0 Intel 82579LM rev 0x05: msi, address
00:25:90:27:da:85
ehci0 at pci0 dev 26 function 0 Intel 6 Series USB rev 0x05: apic 0 int 16
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb4 at pci0 dev 28 function 0 Intel 6 Series PCIE rev 0xb5: msi
pci5 at ppb4 bus 5
ppb5 at pci0 dev 28 function 4 Intel 6 Series PCIE rev 0xb5: msi
pci6 at ppb5 bus 6
em1 at pci6 dev 0 function 0 Intel PRO/1000 MT (82574L) rev 0x00: msi,
address 00:25:90:27:da:84
ehci1 at pci0 dev 29 function 0 Intel 6 Series USB rev 0x05: apic 0 int 23
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb6 at pci0 dev 30 function 0 Intel 82801BA Hub-to-PCI rev 0xa5
pci7 at ppb6 bus 7
vga1 at pci7 dev 3 function 0 Matrox MGA G200eW rev 0x0a
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
pcib0 at pci0 dev 31 function 0 Intel C204 LPC rev 0x05
ahci0 at pci0 dev 31 function 2 Intel 6 Series AHCI rev 0x05: msi,
AHCI 1.3
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 

Re: OpenBSD 5.2-current - panic: mtx_enter: locking against myself

2012-09-12 Thread Martin Pelikan
On Wed, Sep 12, 2012 at 02:18:06PM +0200, Maxim Bourmistrov wrote:
 Hi,
 
 I'm getting panic: mtx_enter: locking against myself on not so
 -current OpenBSD 5.2-current (snapshot).
 
 Machine is not dropping into ddb even if sysctl.conf says it should.
 Console is filled with panic: mtx_enter: locking against myself
 and seems to loop.

Hi!

Can we add something along these lines, to know at least something useful
in these cases?  Maybe, if someone had the binary/symbol table lying around,
one could trace where it came from (somewhere near ddb entry perhaps?).

Haven't tested it, though :-(
--
Martin Pelikan


Index: arch/amd64/amd64/mutex.S
===
RCS file: /cvs/src/sys/arch/amd64/amd64/mutex.S,v
retrieving revision 1.8
diff -u -p -r1.8 mutex.S
--- arch/amd64/amd64/mutex.S24 Sep 2010 13:21:30 -  1.8
+++ arch/amd64/amd64/mutex.S12 Sep 2012 17:51:02 -
@@ -83,9 +83,10 @@ ENTRY(mtx_enter)
jz  1b
jmp 3b
 #ifdef DIAGNOSTIC
-4: movq$5f, %rdi
+4: movq%rdi, %rsi
+   movq$5f, %rdi
call_C_LABEL(panic)
-5: .asciz  mtx_enter: locking against myself
+5: .asciz  mtx_enter: locking against myself, %p
 #endif
 
 ENTRY(mtx_enter_try)