Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Mar 1999 14:08:40 +0000
From:      Thierry.Besancon@lps.ens.fr (Thierry Besancon)
To:        freebsd-smp@freebsd.org, dwhite@gdi.uoregon.edu
Cc:        besancon@lps.ens.fr, Pierre.David@prism.uvsq.fr, jt@ratp.fr
Subject:   lockmgr() panic
Message-ID:  <199903101308.NAA24194@excalibur.lps.ens.fr>

next in thread | raw e-mail | index | archive | help
	Hello

I have in production a ASUS P2B machine with dual 350 MHz PII
(with Intel 440BX chip ?) and 512 Mb of ram.
It runs FreeBSD 3.1

It paniced last week so I compiled in DDB in order to have more
information. Today it paniced again, with the following messages :

	Fatal trap 12: page fault while in kernel mode
	mp_lock = 010000002; cpuid = 1; lapic.id = 00000000
	fault virtual address   = 0xb8
	fault code              = supervisor read, page not present
	instruction pointer     = 0x8:0xf01430a7
	stack pointer           = 0x10:0xff804eb4
	frame pointer           = 0x10:0xff804ec8
	code segment            = base 0x0, limit 0xfffff, type 0x1b
				= DPL 0, pres 1, def32 1, gran 1
	processor eflags        = interrupt enabled, resume, IOPL = 0
	current process         = Idle
	interrupt mask          = net tty bio cam  <- SMP : XXX
	kernel: type 12 trap, code=0
	Stopped at tsleep+0x1b:  movl  0xb8(%ebx),%eax

The "trace" command gave :

	db> trace
	tsleep(f027bab4,4,f023b455,0,f027bab4) at tsleep+0x1b
	acquire(f027bab4,1000000,600,f027bab4,c6040000) at acquire+0x91
	lockmgr(f027bab4,2,0,0,1) at lockmgr+0x260
	kmem_malloc(f027bab4,1000,1,f113f300,ff804f88) at kmem_malloc+0x51
	m_clalloc(1,1) ar m_clalloc+0x2e
	fxp_add_rfabuf(f1762e00,f11e9980) at fxp_add_rfabuf+0xa5
	fxp_intr(f1762e00,0,f0250010,10,0) at fxp_intr+0xe1
	Xresume18() at Xresume18+0x51
	--- interrupt, eip = 0xf020dfe0, esp = 0xff804ff0, ebp = 0 ---
	default_halt() at default_halt


(I rebooted with a new kernel with Alan Cox's path about "update_needed" in
src/sys/i386/i386/pmap.c,v just in case it might help but i don't have any
idea whether this patch relates to my bug)


My machine doesn't panic when running this piece of C code found in the
mailing list :
	#include <sys/param.h>
	#include <sys/mman.h>
	#include <err.h>
	#include <stdlib.h>
	#define SIZE            (32 * 1024 * 1024)
	int
	main(void)
	{
		void *p;
		char vec[SIZE / PAGE_SIZE];
		p = malloc(SIZE);
		if (mincore(p, SIZE, vec) != 0)
			err(1, "mincore");
		return (0);
	}


While typing this mail, my machine paniced again with a more explicit message ?

	panic: lockmgr: locking against myself
	mp_lock = 010000003 ; cpuid = 1; lapic.id = 00000000
	Debugger("panic")
	Stopped at      Debugger+0x37:  movl    $0,in_Debugger

	db> trace
	Debugger(f0230f52) at Debugger+0x37
	panic() at panic+0xa4
	lockmgr() at lockmgr+0x228
	vm_map_growstack() at vm_map_growstack+0x29
	grow_stack() at grow_stack+0xe
	trap_pfault() at trap+0x33e
	calltap() at calltrap+0x3c
	--- trap 0xc, eip = 0xf020c3a3, esp = 0xfa7f6d6c, ebp = 0xfa7f6d84 ---
	pmap_enter() at pmap_enter+0xa7
	vm_fault() at vm_fault+0x83a
	trap_pfault() at trap_pfault+0xc4
	trap() at trap+0x33e
	calltrap() at calltrap+0x3c
	--- trap 0xc, eip = ..., esp = ..., ebp = ... ---
	zalloci() at zalloci+0x33
	vm_map_entry_create() at vm_map_entry_create+0x27
	_vm_map_clip_end() at _vm_map_clip_end+0x42
	vm_map_madvise() at vm_map_madvise+0xc9
	madvise() at madvise+0x47
	syscall(27,27,2c,2811c000,efbfb9ec) at syscall+0x187
	Xint0x80_syscall() at Xint0x80_syscall+0x4c


So, does anybody have an idea about why my problem occurs ?

Any fix ?

Thanks in advance.
A special thanks for all the people that made FreeBSD runnable on SMP.

	Thierry


********************************************************************************
********************************************************************************
ps 1 :  here's my "mptable" output

===============================================================================

MPTable, version 2.0.15

-------------------------------------------------------------------------------

MP Floating Pointer Structure:

  location:			BIOS
  physical address:		0x000f6df0
  signature:			'_MP_'
  length:			16 bytes
  version:			1.1
  checksum:			0x3f
  mode:				Virtual Wire

-------------------------------------------------------------------------------

MP Config Table Header:

  physical address:		0x000f69ec
  signature:			'PCMP'
  base table length:		252
  version:			1.1
  checksum:			0x5c
  OEM ID:			'OEM00000'
  Product ID:			'PROD00000000'
  OEM table pointer:		0x00000000
  OEM table size:		0
  entry count:			23
  local APIC address:		0xfee00000
  extended table length:	0
  extended table checksum:	0

-------------------------------------------------------------------------------

MP Config Base Table Entries:

--
Processors:	APIC ID	Version	State		Family	Model	Step	Flags
		 1	 0x11	 BSP, usable	 6	 5	 2	 0x183fbff
		 0	 0x11	 AP, usable	 6	 5	 2	 0x183fbff
--
Bus:		Bus ID	Type
		 0	 PCI   
		 1	 PCI   
		 2	 ISA   
--
I/O APICs:	APIC ID	Version	State		Address
		 2	 0x11	 usable		 0xfec00000
--
I/O Ints:	Type	Polarity    Trigger	Bus ID	 IRQ	APIC ID	PIN#
		ExtINT	 conforms    conforms	     2	   0	      2	   0
		INT	 conforms    conforms	     2	   1	      2	   1
		INT	 conforms    conforms	     2	   0	      2	   2
		INT	 conforms    conforms	     2	   3	      2	   3
		INT	 conforms    conforms	     2	   4	      2	   4
		INT	 conforms    conforms	     2	   5	      2	   5
		INT	 conforms    conforms	     2	   6	      2	   6
		INT	 conforms    conforms	     2	   7	      2	   7
		INT	 conforms    conforms	     2	   8	      2	   8
		INT	 conforms    conforms	     2	   9	      2	   9
		INT	 conforms    conforms	     2	  14	      2	  14
		INT	 conforms    conforms	     2	  15	      2	  15
		INT	active-lo       level	     2	  11	      2	  16
		INT	active-lo       level	     2	  10	      2	  18
		INT	active-lo       level	     2	  12	      2	  19
--
Local Ints:	Type	Polarity    Trigger	Bus ID	 IRQ	APIC ID	PIN#
		ExtINT	active-hi        edge	     2	   0	    255	   0
		NMI	active-hi        edge	     2	   0	    255	   1

-------------------------------------------------------------------------------

# SMP kernel config file options:


# Required:
options		SMP			# Symmetric MultiProcessor Kernel
options		APIC_IO			# Symmetric (APIC) I/O

# Optional (built-in defaults will work in most cases):
#options		NCPU=2			# number of CPUs
#options		NBUS=3			# number of busses
#options		NAPIC=1			# number of IO APICs
#options		NINTR=24		# number of INTs

===============================================================================

********************************************************************************
********************************************************************************

ps 2 : here's my dmesg output :


Copyright (c) 1992-1999 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California. All rights reserved.
FreeBSD 3.1-RELEASE #5: Wed Mar 10 13:12:39 CET 1999
    besancon@tournesol.lps.ens.fr:/usr/src/sys/compile/TOURNESOL
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium II/Xeon/Celeron (686-class CPU)
  Origin = "GenuineIntel"  Id = 0x652  Stepping=2
  Features=0x183fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,<b24>>
real memory  = 536870912 (524288K bytes)
avail memory = 519774208 (507592K bytes)
Programming 24 pins in IOAPIC #0
FreeBSD/SMP: Multiprocessor motherboard
 cpu0 (BSP): apic id:  1, version: 0x00040011, at 0xfee00000
 cpu1 (AP):  apic id:  0, version: 0x00040011, at 0xfee00000
 io0 (APIC): apic id:  2, version: 0x00170011, at 0xfec00000
Preloaded elf kernel "kernel" at 0xf02d7000.
Probing for devices on PCI bus 0:
chip0: <Intel 82443BX host to PCI bridge> rev 0x02 on pci0.0.0
chip1: <Intel 82443BX host to AGP bridge> rev 0x02 on pci0.1.0
chip2: <Intel 82371AB PCI to ISA bridge> rev 0x02 on pci0.4.0
ide_pci0: <Intel PIIX4 Bus-master IDE controller> rev 0x01 on pci0.4.1
chip3: <Intel 82371AB Power management controller> rev 0x02 on pci0.4.3
fxp0: <Intel EtherExpress Pro 10/100B Ethernet> rev 0x02 int a irq 18 on pci0.10.0
fxp0: Ethernet address 00:a0:c9:43:9d:99
ncr0: <ncr 53c875 fast20 wide scsi> rev 0x26 int a irq 16 on pci0.12.0
Probing for devices on PCI bus 1:
vga0: <ATI model 4742 graphics accelerator> rev 0x5c int a irq 16 on pci1.0.0
Probing for devices on the ISA bus:
sc0 on isa
sc0: VGA color <16 virtual consoles, flags=0x0>
atkbdc0 at 0x60-0x6f on motherboard
atkbd0 irq 1 on isa
psm0 not found
sio0 at 0x3f8-0x3ff irq 4 flags 0x10 on isa
sio0: type 16550A
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1.44MB 3.5in
wdc0 at 0x1f0-0x1f7 irq 14 on isa
wdc0: unit 0 (wd0): <ST32122A>
wd0: 2014MB (4124736 sectors), 4092 cyls, 16 heads, 63 S/T, 512 B/S
wdc1 at 0x170-0x177 irq 15 on isa
wdc1: unit 0 (atapi): <CD-ROM CDU701/1.0q>, removable, accel, dma, iordis
acd0: drive speed 2412KB/sec, 128KB cache
acd0: supported read types: CD-R, CD-RW, CD-DA, packet track
acd0: Audio: play, 256 volume levels
acd0: Mechanism: ejectable tray
acd0: Medium: no/blank disc inside, unlocked
scd0 not found at 0x230
vga0 at 0x3b0-0x3df maddr 0xa0000 msize 131072 on isa
npx0 on motherboard
npx0: INT 16 interface
APIC_IO: Testing 8254 interrupt delivery
APIC_IO: routing 8254 via pin 2
SMP: AP CPU #1 Launched!
changing root device to da0s1a
da0 at ncr0 bus 0 target 0 lun 0
da0: <QUANTUM VIKING II 4.5WLS 4110> Fixed Direct Access SCSI-2 device 
da0: 40.0MB/s transfers (20.0MHz, offset 16, 16bit), Tagged Queueing Enabled
da0: 4350MB (8910423 512 byte sectors: 255H 63S/T 554C)

********************************************************************************
********************************************************************************
ps 3 : here's my kernel config file :


machine		"i386"
cpu		"I686_CPU"
ident		TOURNESOL-SMP
maxusers	128

options		MATH_EMULATE		#Support for x87 emulation
options		INET			#InterNETworking
options		FFS			#Berkeley Fast Filesystem
options		FFS_ROOT		#FFS usable as root device [keep this!]
options		MFS			#Memory Filesystem
options		MFS_ROOT		#MFS usable as root device, "MFS" req'ed
options		NFS			#Network Filesystem
options		NFS_ROOT		#NFS usable as root device, "NFS" req'ed
options		MSDOSFS			#MSDOS Filesystem
options		"CD9660"		#ISO 9660 Filesystem
options		"CD9660_ROOT"		#CD-ROM usable as root. "CD9660" req'ed
options		PROCFS			#Process filesystem
options		"COMPAT_43"		#Compatible with BSD 4.3 [KEEP THIS!]
options		SCSI_DELAY=1500		#Be pessimistic about Joe SCSI device
options		UCONSOLE		#Allow users to grab the console
options		FAILSAFE		#Be conservative
options		USERCONFIG		#boot -c editor
options		VISUAL_USERCONFIG	#visual boot -c editor

config		kernel	root on wd0

# To make an SMP kernel, the next two are needed
options	SMP			# Symmetric MultiProcessor Kernel
options	APIC_IO			# Symmetric (APIC) I/O

controller	isa0
controller	eisa0
controller	pci0

controller	fdc0	at isa? port "IO_FD1" bio irq 6 drq 2
disk		fd0	at fdc0 drive 0

options		"CMD640"	# work around CMD640 chip deficiency
controller	wdc0	at isa? port "IO_WD1" bio irq 14
disk		wd0	at wdc0 drive 0
disk		wd1	at wdc0 drive 1

controller	wdc1	at isa? port "IO_WD2" bio irq 15
disk		wd2	at wdc1 drive 0
disk		wd3	at wdc1 drive 1

#
# ATAPI enables the support for ATAPI-compatible IDE devices
#
options         ATAPI   #Enable ATAPI support for IDE bus
options         ATAPI_STATIC    #Don't do it as an LKM 
# 
# This option allow you to override the default probe time for IDE
# devices, to get a faster probe.  Setting this below 10000 violate   
# the IDE specs, but may still work for you (it will work for most
# people).
# 
options         IDE_DELAY=8000  # Be optimistic about Joe IDE device

# IDE CD-ROM & CD-R/RW  driver - requires wdc controller and ATAPI option
device          acd0

device		da0	#SCSI direct access devices (aka disks)
device		sa0	#SCSI tapes
device		pass0	#CAM passthrough driver
device		cd0	#SCSI CD-ROMs
device          ch0     #SCSI media changers

device		scd0	at isa? port 0x230 bio

# atkbdc0 controlls both the keyboard and the PS/2 mouse
controller	atkbdc0	at isa? port IO_KBD tty
device		atkbd0	at isa? tty irq 1
device		psm0	at isa? tty irq 12

device		vga0	at isa? port ? conflicts

# splash screen/screen saver
pseudo-device	splash

# syscons is the default console driver, resembling an SCO console
device		sc0	at isa? tty
# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
#device		vt0	at isa? tty
#options		XSERVER			# support for X server
#options		FAT_CURSOR		# start with block cursor
# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
#options		PCVT_SCANSET=2		# IBM keyboards are non-std

# 
# The Numeric Processing eXtension driver.  This should be configured if
# your machine has a math co-processor, unless the coprocessor is very
# buggy. If it is not configured then you *must* configure math emulation
# (see above).  If both npx0 and emulation are configured, then only npx0
# is used (provided it works).
device		npx0	at isa? port IO_NPX irq 13

device		sio0	at isa? port "IO_COM1" flags 0x10 tty irq 4
#device		sio1	at isa? port "IO_COM2" tty irq 3

## Parallel port
#device		ppc0	at isa? port? net irq 7
#controller	ppbus0
#device		nlpt0	at ppbus?
#device		plip0	at ppbus?
#device		ppi0	at ppbus?
##controller	vpo0	at ppbus?

# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
# Right now it appears that the ie0 must be probed before ep0. See
# revision 1.20 of this file.
device de0
device fxp0

pseudo-device	loop
pseudo-device	ether
pseudo-device	pty	256

# Enable the kernel debugger.
options         DDB
#options         DDB_UNATTENDED

# KTRACE enables the system-call tracing facility ktrace(2).
# This adds 4 KB bloat to your kernel, and slightly increases
# the costs of each syscall.
options		KTRACE		#kernel tracing

# This provides support for System V shared memory and message queues.
#
options		SYSVSHM
options		SYSVMSG
options         SYSVSEM

#  The `bpfilter' pseudo-device enables the Berkeley Packet Filter.  Be
#  aware of the legal and administrative consequences of enabling this
#  option.  The number of devices determines the maximum number of
#  simultaneous BPF clients programs runnable.
#pseudo-device	bpfilter 4	#Berkeley packet filter

#####################################################################

options         NETATALK                #Appletalk communications protocols

controller      ncr0
controller      scbus0 at ncr0
disk            da0   at scbus0 target 0
disk            da1   at scbus0 target 1
disk            da2   at scbus0 target 2
disk            da3   at scbus0 target 3
disk            da4   at scbus0 target 4
disk            da5   at scbus0 target 5
disk            da6   at scbus0 target 6

options         SCSI_REPORT_GEOMETRY   

options         "MD5"   
options         "ICMP_BANDLIM"

# 
# This allows you to actually store this configuration file into
# the kernel binary itself, where it may be later read by saying:
#    strings -aout -n 3 /kernel | grep ^___ | sed -e 's/^___//' > MYKERNEL
#
options         INCLUDE_CONFIG_FILE     # Include this file in kernel

#
# If you want to disable loadable kernel modules (LKM), you
# might want to use this option.
#
#options                NO_LKM

#
# Disable swapping. This option removes all code which actually performs
# swapping, so it's not possible to turn it back on at run-time.
#
# This is sometimes usable for systems which don't have any swap space
# (see also sysctls "vm.defer_swapspace_pageouts" and
# "vm.disable_swapspace_pageouts")
#
#options        NO_SWAPPING

#pseudo-device   vn              #Vnode driver (turns a file into a device)
pseudo-device   snp     3       #Snoop device - to look at pty/vty/etc..
#pseudo-device	ppp	1
#pseudo-device	tun	1
#pseudo-device	gzip		# Exec gzipped a.out's


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903101308.NAA24194>