Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 May 2006 08:38:50 GMT
From:      Roman Petrukhine <roman@comstar.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/97595: FreeBSD 6.1-RELEASE - "lockmgr: locking against myself"
Message-ID:  <200605220838.k4M8coZ9010577@www.freebsd.org>
Resent-Message-ID: <200605220840.k4M8eEwT026142@freefall.freebsd.org>

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

>Number:         97595
>Category:       kern
>Synopsis:       FreeBSD 6.1-RELEASE  - "lockmgr: locking against myself"
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 22 08:40:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Roman Petrukhine
>Release:        6.1-RELEASE
>Organization:
JSC "Comstar United Telesystems"
>Environment:
FreeBSD alnitak.comstar.ru 6.1-RELEASE FreeBSD 6.1-RELEASE #2: Mon May 22 10:48:26 MSD 2006     maxim@alnitak.comstar.ru:/usr/obj/usr/src/sys/Alnitak.kern  i386

>Description:
An attempt to use union_fs in 6.1-RELEASE
produce a  "panic: lockmgr: locking against myself".
I know about union_fs instability, but from early 4.x to 5.3-RELEASE 
all of this works fine and stable, and used by me to manage read-only system
binary tree under user's jails.


GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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-marcel-freebsd".

Unread portion of the kernel message buffer:
panic: lockmgr: locking against myself
cpuid = 0
Uptime: 1m34s
Dumping 2047 MB (2 chunks)
  chunk 0: 1MB (158 pages) ... ok
  chunk 1: 2047MB (524000 pages) 2031 2015 1999 1983 1967 1951 1935 1919 1903 1887 1871 1855 1839 1823 1807 1791 1775 1759 1743 1727 1711 1695 1679 1663 1647 1631 1615 1599 1583 1567 1551 1535 1519 1503 1487 1471 1455 1439 1423 1407 1391 1375 1359 1343 1327 1311 1295 1279 1263 1247 1231 1215 1199 1183 1167 1151 1135 1119 1103 1087 1071 1055 1039 1023 1007 991 975 959 943 927 911 895 879 863 847 831 815 799 783 767 751 735 719 703 687 671 655 639 623 607 591 575 559 543 527 511 495 479 463 447 431 415 399 383 367 351 335 319 303 287 271 255 239 223 207 191 175 159 143 127 111 95 79 63 47 31 15

#0  doadump () at pcpu.h:165
165             __asm __volatile("movl %%fs:0,%0" : "=r" (td));
(kgdb) where
#0  doadump () at pcpu.h:165
#1  0xc05001bd in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:402
#2  0xc0500515 in panic (fmt=0xc06a424d "lockmgr: locking against myself")
    at /usr/src/sys/kern/kern_shutdown.c:558
#3  0xc04f4232 in lockmgr (lkp=0xc6aa2498, flags=12290, interlkp=0x80, td=0xc66d4180)
    at /usr/src/sys/kern/kern_lock.c:320
#4  0xc054f2ee in vop_stdlock (ap=0x0) at /usr/src/sys/kern/vfs_default.c:257
#5  0xc0685ddb in VOP_LOCK_APV (vop=0xc06dca80, a=0xe6b02aac) at vnode_if.c:1642
#6  0xc05658b0 in vn_lock (vp=0xc6aa2440, flags=4098, td=0xc66d4180) at vnode_if.h:844
#7  0xc0551130 in lookup (ndp=0xe6b02c00) at /usr/src/sys/kern/vfs_lookup.c:384
#8  0xc0550dc2 in namei (ndp=0xe6b02c00) at /usr/src/sys/kern/vfs_lookup.c:203
#9  0xc055f47d in kern_stat (td=0xc66d4180, path=0x0, pathseg=UIO_USERSPACE, sbp=0xe6b02c74)
    at /usr/src/sys/kern/vfs_syscalls.c:2076
#10 0xc055f42b in stat (td=0xc66d4180, uap=0xe6b02d04) at /usr/src/sys/kern/vfs_syscalls.c:2061
#11 0xc067436b in syscall (frame=
      {tf_fs = 59, tf_es = 59, tf_ds = -1078001605, tf_edi = -1077944224, tf_esi = 134648240, tf_ebp = -1077944072, tf_isp = -424661660, tf_ebx = 672066880, tf_edx = 134648064, tf_ecx = 134648245, tf_eax = 188, tf_trapno = 12, tf_err = 2, tf_eip = 673135243, tf_cs = 51, tf_eflags = 662, tf_esp = -1077945396, tf_ss = 59})
    at /usr/src/sys/i386/i386/trap.c:981
#12 0xc066122f in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:200
#13 0x00000033 in ?? ()
Previous frame inner to this frame (corrupt stack?)
(kgdb) backtrace
#0  doadump () at pcpu.h:165
#1  0xc05001bd in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:402
#2  0xc0500515 in panic (fmt=0xc06a424d "lockmgr: locking against myself")
    at /usr/src/sys/kern/kern_shutdown.c:558
#3  0xc04f4232 in lockmgr (lkp=0xc6aa2498, flags=12290, interlkp=0x80, td=0xc66d4180)
    at /usr/src/sys/kern/kern_lock.c:320
#4  0xc054f2ee in vop_stdlock (ap=0x0) at /usr/src/sys/kern/vfs_default.c:257
#5  0xc0685ddb in VOP_LOCK_APV (vop=0xc06dca80, a=0xe6b02aac) at vnode_if.c:1642
#6  0xc05658b0 in vn_lock (vp=0xc6aa2440, flags=4098, td=0xc66d4180) at vnode_if.h:844
#7  0xc0551130 in lookup (ndp=0xe6b02c00) at /usr/src/sys/kern/vfs_lookup.c:384
#8  0xc0550dc2 in namei (ndp=0xe6b02c00) at /usr/src/sys/kern/vfs_lookup.c:203
#9  0xc055f47d in kern_stat (td=0xc66d4180, path=0x0, pathseg=UIO_USERSPACE, sbp=0xe6b02c74)
    at /usr/src/sys/kern/vfs_syscalls.c:2076
#10 0xc055f42b in stat (td=0xc66d4180, uap=0xe6b02d04) at /usr/src/sys/kern/vfs_syscalls.c:2061
#11 0xc067436b in syscall (frame=
      {tf_fs = 59, tf_es = 59, tf_ds = -1078001605, tf_edi = -1077944224, tf_esi = 134648240, tf_ebp = -1077944072, tf_isp = -424661660, tf_ebx = 672066880, tf_edx = 134648064, tf_ecx = 134648245, tf_eax = 188, tf_trapno = 12, tf_err = 2, tf_eip = 673135243, tf_cs = 51, tf_eflags = 662, tf_esp = -1077945396, tf_ss = 59})
    at /usr/src/sys/i386/i386/trap.c:981
#12 0xc066122f in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:200
#13 0x00000033 in ?? ()

#0  doadump () at pcpu.h:165
165             __asm __volatile("movl %%fs:0,%0" : "=r" (td));
(kgdb) up 
#1  0xc05001bd in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:402
402                     doadump();
(kgdb) up 
#2  0xc0500515 in panic (fmt=0xc06a424d "lockmgr: locking against myself")
    at /usr/src/sys/kern/kern_shutdown.c:558
558             boot(bootopt);
(kgdb) 
#3  0xc04f4232 in lockmgr (lkp=0xc6aa2498, flags=12290, interlkp=0x80, td=0xc66d4180)
    at /usr/src/sys/kern/kern_lock.c:320
320                                     panic("lockmgr: locking against myself");
(kgdb) 
#4  0xc054f2ee in vop_stdlock (ap=0x0) at /usr/src/sys/kern/vfs_default.c:257
257             return (lockmgr(vp->v_vnlock, ap->a_flags, VI_MTX(vp), ap->a_td));
(kgdb) 
#5  0xc0685ddb in VOP_LOCK_APV (vop=0xc06dca80, a=0xe6b02aac) at vnode_if.c:1642
1642                    rc = vop->vop_lock(a);
(kgdb) 
#6  0xc05658b0 in vn_lock (vp=0xc6aa2440, flags=4098, td=0xc66d4180) at vnode_if.h:844
844             a.a_td = td;
(kgdb) 
#7  0xc0551130 in lookup (ndp=0xe6b02c00) at /usr/src/sys/kern/vfs_lookup.c:384
384             vn_lock(dp, cnp->cn_lkflags | LK_RETRY, td);
(kgdb) 
#8  0xc0550dc2 in namei (ndp=0xe6b02c00) at /usr/src/sys/kern/vfs_lookup.c:203
203                     error = lookup(ndp);
(kgdb) 
#9  0xc055f47d in kern_stat (td=0xc66d4180, path=0x0, pathseg=UIO_USERSPACE, sbp=0xe6b02c74)
    at /usr/src/sys/kern/vfs_syscalls.c:2076
2076            if ((error = namei(&nd)) != 0)
(kgdb) 
#10 0xc055f42b in stat (td=0xc66d4180, uap=0xe6b02d04) at /usr/src/sys/kern/vfs_syscalls.c:2061
2061            error = kern_stat(td, uap->path, UIO_USERSPACE, &sb);
(kgdb) 
#11 0xc067436b in syscall (frame=
      {tf_fs = 59, tf_es = 59, tf_ds = -1078001605, tf_edi = -1077944224, tf_esi = 134648240, tf_ebp = -1077944072, tf_isp = -424661660, tf_ebx = 672066880, tf_edx = 134648064, tf_ecx = 134648245, tf_eax = 188, tf_trapno = 12, tf_err = 2, tf_eip = 673135243, tf_cs = 51, tf_eflags = 662, tf_esp = -1077945396, tf_ss = 59})
    at /usr/src/sys/i386/i386/trap.c:981
981                     error = (*callp->sy_call)(td, args);
(kgdb) 
#12 0xc066122f in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:200
200             call    syscall
Current language:  auto; currently asm
(kgdb) 
#13 0x00000033 in ?? ()
(kgdb) 
Initial frame selected; you cannot go up.

>How-To-Repeat:
alnitak# cd /root/
alnitak# mkdir test
alnitak# cd test/
alnitak# mkdir a
alnitak# ln -s ./a/ ./b
alnitak# ls -la
total 6
drwxr-xr-x  3 root  wheel  512 May 22 12:04 .
drwxr-xr-x  4 root  wheel  512 May 22 12:04 ..
drwxr-xr-x  2 root  wheel  512 May 22 12:04 a
lrwxr-xr-x  1 root  wheel    4 May 22 12:04 b -> ./a/

alnitak# mount_unionfs -o rdonly /root/test/ /mnt
alnitak# mount
/dev/da0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/da0s1e on /usr (ufs, local, soft-updates)
/dev/da0s1f on /v0 (ufs, local, soft-updates)
/dev/da0s1d on /var (ufs, local, soft-updates)
<above>:/root/test on /mnt (unionfs, local, read-only, noclusterw)

alnitak# cd /mnt
alnitak# ls -la
total 6
drwxr-xr-x   5 root  wheel  512 May 22 12:04 .
drwxr-xr-x  20 root  wheel  512 May 18 15:23 ..
drwxr-xr-x   2 root  wheel  512 May 22 12:04 a
lrwxr-xr-x   1 root  wheel    4 May 22 12:04 b -> ./a/
alnitak# cd a
alnitak# ls
alnitak# cd ..
alnitak# cd b/

And the machine panic ...

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



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