On Fri, 2003-11-28 at 01:02, Don Lewis wrote: > On 27 Nov, Stefan Ehmann wrote: > > On Wed, 2003-11-26 at 08:33, Don Lewis wrote: > >> The problem is that selrecord() wants to lock a MTX_DEF mutex, which can > >> cause a context switch if the mutex is already locked by another thread. > >> This is contrary to what bktr_poll() wants to accomplish by calling > >> critical_enter(). > > > > Strange enough that does not seem to happen with a kernel built without > > INVARIANTS and WITNESS. Does this make any sense or is this just by > > chance? > > You might try the patch below with WITNESS enabled. I don't have the > hardware, so I can't test it. It compiles for me, but for all I know it > could delete all your files if you run it. Unfortunately, after running the patched kernel some time I got a slightly different panic: GNU gdb 5.2.1 (FreeBSD) Copyright 2002 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-undermydesk-freebsd"... panic: blockable sleep lock (sleep mutex) sellck _at_ /usr/src/sys/kern/sys_generic.c:1145 panic messages: --- panic: blockable sleep lock (sleep mutex) sellck _at_ /usr/src/sys/kern/sys_generic.c:1145 syncing disks, buffers remaining... 2248 2248 panic: mi_switch: switch in a critical section Uptime: 4m11s Dumping 383 MB 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256 272 288 304 320 336 352 368 --- Reading symbols from /boot/kernel/snd_pcm.ko...done. Loaded symbols for /boot/kernel/snd_pcm.ko Reading symbols from /boot/kernel/snd_csa.ko...done. Loaded symbols for /boot/kernel/snd_csa.ko Reading symbols from /boot/kernel/bktr_mem.ko...done. Loaded symbols for /boot/kernel/bktr_mem.ko Reading symbols from /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/linprocfs/linprocfs.ko.debug...done. Loaded symbols for /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/linprocfs/linprocfs.ko.debug Reading symbols from /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/linux/linux.ko.debug...done. Loaded symbols for /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/linux/linux.ko.debug Reading symbols from /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/ext2fs/ext2fs.ko.debug...done. Loaded symbols for /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/ext2fs/ext2fs.ko.debug Reading symbols from /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/ntfs/ntfs.ko.debug...done. Loaded symbols for /usr/obj/usr/src/sys/SHOE/modules/usr/src/sys/modules/ntfs/ntfs.ko.debug Reading symbols from /boot/kernel/bktr.ko...done. Loaded symbols for /boot/kernel/bktr.ko #0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240 240 dumping++; (kgdb) bt #0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240 #1 0xc050f482 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:372 #2 0xc050f7d8 in panic () at /usr/src/sys/kern/kern_shutdown.c:550 #3 0xc05174e5 in mi_switch () at /usr/src/sys/kern/kern_synch.c:470 #4 0xc050f16e in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:312 #5 0xc050f7d8 in panic () at /usr/src/sys/kern/kern_shutdown.c:550 #6 0xc0535e19 in witness_lock (lock=0xc075c8a0, flags=8, file=0xc06c4d72 "/usr/src/sys/kern/sys_generic.c", line=1145) at /usr/src/sys/kern/subr_witness.c:609 #7 0xc0505aaa in _mtx_lock_flags (m=0xc075c8a0, opts=0, file=0xc06f10bc "äLmĀ\t", line=-1009577024) at /usr/src/sys/kern/kern_mutex.c:221 #8 0xc053a016 in selrecord (selector=0xc3d313c0, sip=0xc075c8a0) at /usr/src/sys/kern/sys_generic.c:1145 #9 0xc4174981 in bktr_close () from /boot/kernel/bktr.ko #10 0xc04c6650 in spec_poll (ap=0xd8cdbafc) at /usr/src/sys/fs/specfs/spec_vnops.c:379 #11 0xc04c5a88 in spec_vnoperate (ap=0x0) at /usr/src/sys/fs/specfs/spec_vnops.c:122 #12 0xc057635c in vn_poll (fp=0x0, events=0, active_cred=0xc412b080, td=0x0) at vnode_if.h:537 #13 0xc0539851 in selscan (td=0xc3d313c0, ibits=0xd8cdbb9c, obits=0xd8cdbb8c, nfd=6) at /usr/src/sys/sys/file.h:272 #14 0xc05393bf in kern_select (td=0xc3d313c0, nd=6, fd_in=0xbfbfeb90, fd_ou=0x0, fd_ex=0x0, tvp=0x0) at /usr/src/sys/kern/sys_generic.c:816 #15 0xc0539026 in select (td=0x0, uap=0xd8cdbd14) at /usr/src/sys/kern/sys_generic.c:720 #16 0xc06827e0 in syscall (frame= {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = -1, tf_esi = 134598312, tf_ebp = -1077941208, tf_isp = -657605260, tf_ebx = 0, tf_edx = 6, tf_ecx = -1077941360, tf_eax = 93, tf_trapno = 12, tf_err = 2, tf_eip = 673044815, tf_cs = 31, tf_eflags = 658, tf_esp = -1077941444, tf_ss = 47}) at /usr/src/sys/i386/i386/trap.c:1010 #17 0xc067444d in Xint0x80_syscall () at {standard input}:136 (kgdb)Received on Fri Nov 28 2003 - 00:31:13 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:31 UTC