Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jul 2002 10:50:17 +0200 (CEST)
From:      BOUWSMA Beery <freebsd-misuser@ipv6.netscum.dyndns.dk>
To:        freebsd-stable@freebsd.org
Subject:   compact2 panic, probably unionfs-related, in months-old stable
Message-ID:  <200207170850.g6H8oHs00577@beerswilling.netscum.dyndns.dk>

next in thread | raw e-mail | index | archive | help
[danger, ipv6-only e-mail address; remove the obvious if you're
 not ipv6-capable and need to reply to me directly]

This panic seems to have happened, when I tried futzing around in
a unionfs-mounted writeable directory atop a read-only source
repository.  Soon, I'll see if it's repeatable...


System details are -stable, from early March, with the panicking
kernel rebuilt on 20.Jun, I'm hoping from the same old source, but
it's possible I built that kernel alone from newer source (I did a
test buildworld/kernel but no installworld afterwards, so no clues
remain in my source tree)


This GDB was configured as "i386-unknown-freebsd"...
IdlePTD at phsyical address 0x00412000
initial pcb at physical address 0x00337820
panicstr: ufs_direnter: compact2
panic messages:
---
panic: ufs_direnter: compact2

syncing disks... 25 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12

giving up on 8 buffers
Uptime: 11h24m20s


(kgdb) bt
#0  dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487
#1  0xc016e64f in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:316
#2  0xc016ea8d in panic (fmt=0xc02d14de "ufs_direnter: compact2")
    at /usr/src/sys/kern/kern_shutdown.c:595
#3  0xc0218922 in ufs_direnter (dvp=0xc7915e00, tvp=0x0, dirp=0xc7694ce4,
    cnp=0xc7694ec0, newdirbp=0x0) at /usr/src/sys/ufs/ufs/ufs_lookup.c:907
#4  0xc021b525 in ufs_rename (ap=0xc7694e20)
    at /usr/src/sys/ufs/ufs/ufs_vnops.c:1105
#5  0xc021cc3d in ufs_vnoperate (ap=0xc7694e20)
    at /usr/src/sys/ufs/ufs/ufs_vnops.c:2422
#6  0xc176739f in ?? ()
#7  0xc01a1353 in rename (p=0xc76855e0, uap=0xc7694f80) at vnode_if.h:645
#8  0xc0296ff5 in syscall2 (frame={tf_fs = 47, tf_es = 47, tf_ds = 47,
      tf_edi = 178045, tf_esi = -1077937732, tf_ebp = -1077937220,
      tf_isp = -949399596, tf_ebx = -1077937732, tf_edx = -1, tf_ecx = 2,
      tf_eax = 128, tf_trapno = 0, tf_err = 2, tf_eip = 671781748, tf_cs = 31,
      tf_eflags = 647, tf_esp = -1077937776, tf_sss = 47})
    at /usr/src/sys/i386/i386/trap.c:1167
#9  0xc0289bb5 in Xint0x80_syscall ()
#10 0x804b1f8 in ?? ()
#11 0x8049005 in ?? ()

(kgdb) up 3
#3  0xc0218922 in ufs_direnter (dvp=0xc7915e00, tvp=0x0, dirp=0xc7694ce4,
    cnp=0xc7694ec0, newdirbp=0x0) at /usr/src/sys/ufs/ufs/ufs_lookup.c:907
907                             panic("ufs_direnter: compact2");

(kgdb) l
902                     if (spacefree + dsize < newentrysize)
903                             panic("ufs_direnter: compact1");
904                     dirp->d_reclen = spacefree + dsize;
905             } else {
906                     if (spacefree < newentrysize)
907                             panic("ufs_direnter: compact2");
908                     dirp->d_reclen = spacefree;
909                     ep->d_reclen = dsize;
910                     ep = (struct direct *)((char *)ep + dsize);
911             }
(kgdb) p spacefree
$1 = 0
(kgdb) p newentrysize
$2 = 28



-rw-r--r--  1 root  wheel  36013 Oct 31  2001 /usr/src/sys/ufs/ufs/ufs_lookup.c

(kgdb) p dsize
$3 = 24

(kgdb) p *ep
$5 = {d_ino = 113637, d_reclen = 24, d_type = 8 '\b', d_namlen = 14 '\016',
  d_name = "mergemaster.sh\000Ç\001\000\000\000\034\000\016\023mergemaster.sh.or
ig\000§À\001\000´\001\b\022mergemaster.sh-OLD\000Ç", '\000' <repeats 183 times>}


The unionfs shadow directory mounted rw atop /usr/src contents look
somewhat like this after the reboot:

bash-2.05a$ ls -larti /usr/local/source-hacks/usr.sbin/mergemaster/
total 68
114854 -rwxr-xr-x    1 root  wheel  27677 Jun 25 00:29 mergemaster.sh.orig
114855 -rwxr-xr-x    1 root  wheel  33365 Jun 26 13:38 mergemaster.sh-OLD
114852 drwxr-xr-x  149 root  wheel   3072 Jun 27 02:11 ..
114853 drwxr-xr-x    2 root  wheel    512 Jul 17 09:01 .


The /usr/src under the unionfs mount is a nullfs mount from elsewhere
whose contents look like this:

bash-2.05a$ ls -larti /usr/local/system/src/usr.sbin/mergemaster/
total 100
167961 -rwxr-xr-x    1 root  wheel  25185 Aug 11  2001 mergemaster.sh-DIST
168619 -rwxr-xr-x    1 root  wheel  25185 Aug 11  2001 mergemaster.sh.orig
167958 -rw-r--r--    1 root  wheel    189 Oct 31  2001 Makefile
167244 drwxr-xr-x  154 root  wheel   4096 Jun 25 00:29 ..
174143 -rw-r--r--    1 root  wheel  10683 Jun 25 00:29 mergemaster.8
178045 -rwxr-xr-x    1 root  wheel  27696 Jul  1 15:24 mergemaster.sh
167957 drwxr-xr-x    2 root  wheel    512 Jul  1 15:24 .

The kernel has UFS_DIRHASH and the filesystems were mounted with
softupdates.  `ep' and `nep' in the trace seem identical.

My poor brane can't figure out anything much more; while the fs
was newfs'ed with probably a non-default value or two for inode
count or file size, the value shouldn't be too far off (it's a
bog-standard /usr filesystem, not a CD-WAV archive), and I don't
think the hacks I've applied affect this part of the k0deZ.


Lessee if this panic is repeatable...  Hrm, nope, or else I'm
doing things differently now than when it panicked.  Sorry.

Submitted for your amusement, I guess


thanks
barry bouwsma


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




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