Date: Mon, 4 Dec 2000 10:10:26 +0200 (IST) From: roman@xpert.com To: FreeBSD-gnats-submit@freebsd.org Subject: kern/23258: panic: allocdirect_check; panic: softdep_lock: locking against myself Message-ID: <200012040810.eB48AQZ36296@trinity.harmonic.co.il> Resent-Message-ID: <200012040820.eB48K2M75771@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number:         23258
>Category:       kern
>Synopsis:       panic: softdep_lock: locking against myself
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 04 00:20:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Roman Shterenzon
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
>Environment:
kernel config file:
# MATRIX kernel config
machine		i386
cpu		I686_CPU
ident		MATRIX
maxusers	128
#makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
options 	INET			#InterNETworking
options 	FFS			#Berkeley Fast Filesystem
options 	FFS_ROOT		#FFS usable as root device [keep this!]
options 	SOFTUPDATES		#Enable FFS soft updates support
options 	NFS			#Network Filesystem
options 	CD9660			#ISO 9660 Filesystem
options 	PROCFS			#Process filesystem
options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
options 	SCSI_DELAY=5000		#Delay (in ms) before probing SCSI
options 	UCONSOLE		#Allow users to grab the console
options 	USERCONFIG		#boot -c editor
options 	VISUAL_USERCONFIG	#visual boot -c editor
options 	KTRACE			#ktrace(1) support
options 	SYSVSHM			#SYSV-style shared memory
options 	SYSVMSG			#SYSV-style message queues
options 	SYSVSEM			#SYSV-style semaphores
options 	P1003_1B		#Posix P1003_1B real-time extensions
options 	_KPOSIX_PRIORITY_SCHEDULING
options		ICMP_BANDLIM		#Rate limit bad replies
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
options		NMBCLUSTERS=1024
# To make an SMP kernel, the next two are needed
#options 	SMP			# Symmetric MultiProcessor Kernel
#options 	APIC_IO			# Symmetric (APIC) I/O
# Optionally these may need tweaked, (defaults shown):
#options 	NCPU=2			# number of CPUs
#options 	NBUS=4			# number of busses
#options 	NAPIC=1			# number of IO APICs
#options 	NINTR=24		# number of INTs
device		isa
device		eisa
device		pci
# Floppy drives
device		fdc0	at isa? port IO_FD1 irq 6 drq 2
device		fd0	at fdc0 drive 0
# ATA and ATAPI devices
device		ata
device		atadisk			# ATA disk drives
device		atapicd			# ATAPI CDROM drives
options 	ATA_STATIC_ID		#Static device numbering
options 	ATA_ENABLE_ATAPI_DMA	#Enable DMA on ATAPI devices
# SCSI Controllers
device		ahc		# AHA2940 and onboard AIC7xxx devices
# SCSI peripherals
device		scbus		# SCSI bus (required)
device		da		# Direct Access (disks)
device		sa		# Sequential Access (tape etc)
device		cd		# CD
device		pass		# Passthrough device (direct SCSI access)
# atkbdc0 controls both the keyboard and the PS/2 mouse
device		atkbdc0	at isa? port IO_KBD
device		atkbd0	at atkbdc? irq 1 flags 0x1
device		psm0	at atkbdc? irq 12
device		vga0	at isa?
# splash screen/screen saver
pseudo-device	splash
# syscons is the default console driver, resembling an SCO console
device		sc0	at isa? flags 0x100
# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
#device		vt0	at isa?
#options 	XSERVER			# support for X server on a vt console
#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
# Floating point support - do not disable.
device		npx0	at nexus? port IO_NPX irq 13
# Power management support (see LINT for more options)
#device		apm0    at nexus?
# Serial (COM) ports
device		sio0	at isa? port IO_COM1 flags 0x10 irq 4
device		sio1	at isa? port IO_COM2 irq 3
device		sio2	at isa? disable port IO_COM3 irq 5
device		sio3	at isa? disable port IO_COM4 irq 9
# Parallel port
device		ppc0	at isa? irq 7
device		ppbus		# Parallel port bus (required)
device		lpt		# Printer
# PCI Ethernet NICs.
device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)
# Pseudo devices - the number indicates how many units to allocated.
pseudo-device	loop		# Network loopback
pseudo-device	ether		# Ethernet support
pseudo-device	tun		# Packet tunnel.
pseudo-device	pty		# Pseudo-ttys (telnet etc)
pseudo-device	md		# Memory "disks"
pseudo-device	vn		# Vnode driver
pseudo-device	snp		# TTY snoop driver
# The `bpf' pseudo-device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
pseudo-device	bpf		#Berkeley packet filter
# USB support
device		uhci		# UHCI PCI->USB interface
device		usb		# USB Bus (required)
device		ugen		# Generic
device		uhid		# "Human Interface Devices"
device		ukbd		# Keyboard
device		umass		# Disks/Mass storage - Requires scbus and da
device		ums		# Mouse
# Intel Power Management devices
device		intpm
device		smbus
device		smb
#device		iicbus
#device		iicbb
#device		iic
#device		iicsmb
dmesg:
Copyright (c) 1992-2000 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 4.1-RELEASE #0: Mon Oct 16 12:16:14 IST 2000
    root@matrix.harmonic.co.il:/usr/src/sys/compile/MATRIX
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 646667219 Hz
CPU: Pentium III/Pentium III Xeon/Celeron (646.67-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x683  Stepping = 3
  Features=0x387fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,PN,MMX,FXSR,XMM>
real memory  = 536805376 (524224K bytes)
avail memory = 518987776 (506824K bytes)
Preloaded elf kernel "kernel" at 0xc0300000.
Pentium Pro MTRR support enabled
md0: Malloc disk
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Intel 82443GX host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib2: <Intel 82443GX (440 GX) PCI-PCI (AGP) bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib2
pcib3: <PCI to PCI bridge (vendor=1011 device=0023)> at device 15.0 on pci1
pci2: <PCI bus> on pcib3
pcib4: <PCI to PCI bridge (vendor=104c device=ac21)> at device 4.0 on pci2
pci3: <PCI bus> on pcib4
ahc0: <Adaptec aic7896/97 Ultra2 SCSI adapter> port 0x2000-0x20ff mem 0xf4100000-0xf4100fff irq 11 at device 12.0 on pci0
ahc0: aic7896/97 Wide Channel A, SCSI Id=7, 16/255 SCBs
ahc1: <Adaptec aic7896/97 Ultra2 SCSI adapter> port 0x2400-0x24ff mem 0xf4101000-0xf4101fff irq 11 at device 12.1 on pci0
ahc1: aic7896/97 Wide Channel B, SCSI Id=7, 16/255 SCBs
fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0x2800-0x283f mem 0xf4000000-0xf40fffff,0xf4102000-0xf4102fff irq 10 at device 14.0 on pci0
fxp0: Ethernet address 00:d0:b7:89:e7:9b
isab0: <Intel 82371AB PCI to ISA bridge> at device 18.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 ATA33 controller> port 0x2860-0x286f at device 18.1 on pci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0x2840-0x285f irq 10 at device 18.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhub0: port 1 power on failed, IOERROR
uhub0: port 2 power on failed, IOERROR
intpm0: <Intel 82371AB Power management controller> port 0x1040-0x104f irq 9 at device 18.3 on pci0
intpm0: I/O mapped 1040
intpm0: intr IRQ 9 enabled revision 0
smbus0: <System Management Bus> on intsmb0
smb0: <SMBus general purpose I/O> on smbus0
intpm0: PM I/O mapped c00 
pci0: <Cirrus Logic GD5480 SVGA controller> at 20.0
pcib1: <Intel 82443GX host to AGP bridge> on motherboard
pci4: <PCI bus> on pcib1
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (ECP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
acd0: CDROM <SAMSUNG CD-ROM SN-124> at ata1-master using PIO4
Waiting 5 seconds for SCSI devices to settle
pass2 at ahc0 bus 0 target 6 lun 0
pass2: <ESG-SHV SCA HSBP M10 0.03> Fixed Processor SCSI-2 device 
pass2: 3.300MB/s transfers
da0 at ahc0 bus 0 target 2 lun 0
da0: <IBM DDYS-T36950M S80D> Fixed Direct Access SCSI-3 device 
da0: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
da0: 35003MB (71687340 512 byte sectors: 255H 63S/T 4462C)
da1 at ahc0 bus 0 target 3 lun 0
da1: <IBM DDYS-T36950M S80D> Fixed Direct Access SCSI-3 device 
da1: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
da1: 35003MB (71687340 512 byte sectors: 255H 63S/T 4462C)
Mounting root from ufs:/dev/da0s1a
WARNING: / was not properly dismounted
vinum: loaded
vinum: reading configuration from /dev/da1s2e
vinum: updating configuration from /dev/da0s2e
Some informationg from kernel debugging session:
Script started on Mon Dec  4 09:44:40 2000
matrix#	gdb -k /usr/src/sys/compile/MATRIX/kernel.debug  vmcore.0
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
IdlePTD 3219456
initial pcb at 29a720
panicstr: softdep_lock: locking against myself
panic messages:
---
panic: allocdirect_check: old 23430272 != new 23430272 || lbn 7 >= 12
syncing disks... panic: softdep_lock: locking against myself
Uptime: 4d18h20m36s
dumping to dev #da/0x20001, offset 774
dump 511 510 509 508 507 506 505 504 503 502 501 500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 482 481 480 479 478 477 476 475 474 473 472 471 470 469 468 467 466 465 464 463 462 461 460 459 458 457 456 455 454 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 432 431 430 429 428 427 426 425 424 423 422 421 420 419 418 417 416 415 414 413 412 411 410 409 408 407 406 405 404 403 402 401 400 399 398 397 396 395 394 393 392 391 390 389 388 387 386 385 384 383 382 381 380 379 378 377 376 375 374 373 372 371 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289 288 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 269 268 267 266 !
 265 264 263 262 261 260 259 258 257 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 
---
#0  boot (howto=260) at ../../kern/kern_shutdown.c:302
302			dumppcb.pcb_cr3 = rcr3();
(kgdb) bt
#0  boot (howto=260) at ../../kern/kern_shutdown.c:302
#1  0xc0153d38 in poweroff_wait (junk=0xc02611a0, howto=-876619400)
    at ../../kern/kern_shutdown.c:552
#2  0xc01e2e31 in acquire_lock (lk=0xc028959c)
    at ../../ufs/ffs/ffs_softdep.c:260
#3  0xc01e7fbc in softdep_count_dependencies (bp=0xcbbfd978, wantcount=0)
    at ../../ufs/ffs/ffs_softdep.c:4518
#4  0xc01eb118 in ffs_fsync (ap=0xd693eac4) at ../../ufs/ffs/ffs_vnops.c:168
#5  0xc01e9caf in ffs_sync (mp=0xc14ccc00, waitfor=2, cred=0xc10c0680, 
    p=0xc02af7e0) at vnode_if.h:537
#6  0xc018092f in sync (p=0xc02af7e0, uap=0x0) at ../../kern/vfs_syscalls.c:544
#7  0xc0153787 in boot (howto=256) at ../../kern/kern_shutdown.c:224
#8  0xc0153d38 in poweroff_wait (junk=0xc02617a0, howto=23430272)
    at ../../kern/kern_shutdown.c:552
#9  0xc01e3f73 in allocdirect_merge (adphead=0xc216ddc4, newadp=0xc16e7c80, 
    oldadp=0xc21909c0) at ../../ufs/ffs/ffs_softdep.c:1270
#10 0xc01e6ce5 in merge_inode_lists (inodedep=0xc216dd80)
    at ../../ufs/ffs/ffs_softdep.c:3660
#11 0xc01e6bab in softdep_update_inodeblock (ip=0xc1cef600, bp=0xcbbe5ba8, 
    waitfor=1) at ../../ufs/ffs/ffs_softdep.c:3607
#12 0xc01e213d in ffs_update (vp=0xd6f48080, waitfor=1)
    at ../../ufs/ffs/ffs_inode.c:105
#13 0xc01eac72 in ffs_write (ap=0xd693eccc)
---Type <return> to continue, or q <return> to quit---
    at ../../ufs/ufs/ufs_readwrite.c:529
#14 0xc01acf76 in nfsrv_writegather (ndp=0xd693ee04, slp=0xc15ec800, 
    procp=0xd41c58e0, mrq=0xd693ee00) at vnode_if.h:363
#15 0xc01c31cf in nfssvc_nfsd (nsd=0xd693ee60, argp=0x807c620 "", p=0xd41c58e0)
    at ../../nfs/nfs_syscalls.c:596
#16 0xc01c2b4b in nfssvc (p=0xd41c58e0, uap=0xd693ef80)
    at ../../nfs/nfs_syscalls.c:303
#17 0xc0236fe1 in syscall2 (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, 
      tf_edi = 0, tf_esi = 0, tf_ebp = -1077936788, tf_isp = -694947884, 
      tf_ebx = 4, tf_edx = 134673012, tf_ecx = -3, tf_eax = 155, 
      tf_trapno = 12, tf_err = 2, tf_eip = 134518272, tf_cs = 31, 
      tf_eflags = 647, tf_esp = -1077937216, tf_ss = 47})
    at ../../i386/i386/trap.c:1126
#18 0xc022bc25 in Xint0x80_syscall ()
#19 0x8048139 in ?? ()
(kgdb) up 9
#9  0xc01e3f73 in allocdirect_merge (adphead=0xc216ddc4, newadp=0xc16e7c80, 
    oldadp=0xc21909c0) at ../../ufs/ffs/ffs_softdep.c:1270
1270			panic("allocdirect_check: old %d != new %d || lbn %ld >= %d",
(kgdb) list
1265			panic("allocdirect_merge: lock not held");
1266	#endif
1267		if (newadp->ad_oldblkno != oldadp->ad_newblkno ||
1268		    newadp->ad_oldsize != oldadp->ad_newsize ||
1269		    newadp->ad_lbn >= NDADDR)
1270			panic("allocdirect_check: old %d != new %d || lbn %ld >= %d",
1271			    newadp->ad_oldblkno, oldadp->ad_newblkno, newadp->ad_lbn,
1272			    NDADDR);
1273		newadp->ad_oldblkno = oldadp->ad_oldblkno;
1274		newadp->ad_oldsize = oldadp->ad_oldsize;
(kgdb) print newadp->ad_oldblkno
$1 = 2003136032
(kgdb) print oldadp->ad_newblkno
Cannot access memory at address 0x18.
(kgdb) print newadp->ad_lbn
$2 = 622879852
(kgdb) up
#10 0xc01e6ce5 in merge_inode_lists (inodedep=0xc216dd80)
    at ../../ufs/ffs/ffs_softdep.c:3660
3660				allocdirect_merge(&inodedep->id_inoupdt, newadp,
(kgdb) list
3655				continue;
3656			}
3657			TAILQ_REMOVE(&inodedep->id_newinoupdt, newadp, ad_next);
3658			TAILQ_INSERT_BEFORE(listadp, newadp, ad_next);
3659			if (listadp->ad_lbn == newadp->ad_lbn) {
3660				allocdirect_merge(&inodedep->id_inoupdt, newadp,
3661				    listadp);
3662				listadp = newadp;
3663			}
3664			newadp = TAILQ_FIRST(&inodedep->id_newinoupdt);
(kgdb) print inodedep->id_inoupdt
Cannot access memory at address 0x144.
(kgdb) print newadp
$3 = (struct allocdirect *) 0xc16e7c80
(kgdb) print *newadp
$4 = {ad_list = {wk_list = {le_next = 0x0, le_prev = 0xcbc6fc7c}, wk_type = 4, 
    wk_state = 5}, ad_next = {tqe_next = 0xc21909c0, tqe_prev = 0xc1f5d80c}, 
  ad_lbn = 7, ad_newblkno = 23430272, ad_oldblkno = 23430272, 
  ad_newsize = 4096, ad_oldsize = 3072, ad_deps = {le_next = 0xc1f5d800, 
    le_prev = 0xc1502150}, ad_buf = 0xcbbdfe20, ad_inodedep = 0xc216dd80, 
  ad_freefrag = 0x0}
(kgdb) print listadp
$5 = (struct allocdirect *) 0x0
(kgdb) print newadp
$6 = (struct allocdirect *) 0xc16e7c80
(kgdb) print *newadp
$7 = {ad_list = {wk_list = {le_next = 0x0, le_prev = 0xcbc6fc7c}, wk_type = 4, 
    wk_state = 5}, ad_next = {tqe_next = 0xc21909c0, tqe_prev = 0xc1f5d80c}, 
  ad_lbn = 7, ad_newblkno = 23430272, ad_oldblkno = 23430272, 
  ad_newsize = 4096, ad_oldsize = 3072, ad_deps = {le_next = 0xc1f5d800, 
    le_prev = 0xc1502150}, ad_buf = 0xcbbdfe20, ad_inodedep = 0xc216dd80, 
  ad_freefrag = 0x0}
(kgdb) quit
matrix#	exit
Script done on Mon Dec  4 09:54:11 2000
I can send more info on request.
>Description:
In the middle of the day the computer crashed.
>How-To-Repeat:
I don't know yet.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012040810.eB48AQZ36296>
