trap in ufs_lookup

1999-01-15 Thread Brian Feldman
   I've got a crash in ufs_lookup, and I'm trying to assess responsibility. I
use SoftUpdates on all drives and _MAY_ have some bad RAM. This crash was
during a make -j4 -DNOCLEAN world, and maybe it may be due to SoftUpdates not
completely having finished the dir, but I'm thinking it could've been RAM
corruption. Someone help me :)

GDB is free software and you are welcome to 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.
GDB 4.16 (i386-unknown-freebsd),
Copyright 1996 Free Software Foundation, Inc...
IdlePTD 2899968
initial pcb at 2425ec
panicstr: vm_fault: fault on nofault entry, addr: f3748000
panic messages:
--- 
panic: vm_fault: fault on nofault entry, addr: f3748000
  
syncing disks... 234 232 223 198 167 150 123 92 63 19 11 1 1 1 1 1 1 1 1 1 givin
g up  
  
dumping to dev 30001, offset 40960
dump 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  boot (howto=256) at ../../kern/kern_shutdown.c:285
285 dumppcb.pcb_cr3 = rcr3();
(kgdb) bt
#0  boot (howto=256) at ../../kern/kern_shutdown.c:285
#1  0xf01383d5 in panic (
fmt=0xf0211d86 vm_fault: fault on nofault entry, addr: %lx)
at ../../kern/kern_shutdown.c:446
#2  0xf01a297e in vm_fault (map=0xf025e014, vaddr=4084498432,
fault_type=1 '\001', fault_flags=0) at ../../vm/vm_fault.c:232
#3  0xf01da750 in trap_pfault (frame=0xf7c46cd0, usermode=0, eva=4084499165)
at ../../i386/i386/trap.c:824
#4  0xf01da3f2 in trap (frame={tf_es = 16, tf_ds = 16, tf_edi = 21209,
  tf_esi = -247132928, tf_ebp = -138121840, tf_isp = -138121992,
  tf_ebx = -210468135, tf_edx = -222954112, tf_ecx = 8191, tf_eax = 37593,  
  tf_trapno = 12, tf_err = 0, tf_eip = -266750417, tf_cs = 8,
  tf_eflags = 66178, tf_esp = -138278720, tf_ss = -138121524})
at ../../i386/i386/trap.c:437 
#5  0xf019b62f in ufs_lookup (ap=0xf7c46dcc) at ../../ufs/ufs/ufs_lookup.c:238 
#6  0xf01a03e9 in ufs_vnoperate (ap=0xf7c46dcc) 
at ../../ufs/ufs/ufs_vnops.c:2294
#7  0xf0157f30 in vfs_cache_lookup (ap=0xf7c46e28) at vnode_if.h:55
#8  0xf01a03e9 in ufs_vnoperate (ap=0xf7c46e28)
at ../../ufs/ufs/ufs_vnops.c:2294
#9  0xf015a405 in lookup (ndp=0xf7c46ea8) at vnode_if.h:31
#10 0xf0159ed8 in namei (ndp=0xf7c46ea8) at ../../kern/vfs_lookup.c:152
#11 0xf015f5a0 in stat (p=0xf7b8b3c0, uap=0xf7c46f84)
---Type return to continue, or q return to quit---
at ../../kern/vfs_syscalls.c:1614
#12 0xf01dad47 in syscall (frame={tf_es = 39, tf_ds = 39, tf_edi = 136292736,
  tf_esi = 0, tf_ebp = -272644404, tf_isp = -138121260,
  tf_ebx = 134749056, tf_edx = 12, tf_ecx = 134749056, tf_eax = 188,
  tf_trapno = 12, tf_err = 2, tf_eip = 134580048, tf_cs = 31,
  tf_eflags = 582, tf_esp = -272644524, tf_ss = 39})
at ../../i386/i386/trap.c:1100
#13 0xf01cd85c in Xint0x80_syscall ()
#14 0x8050303 in ?? ()
#15 0x8049761 in ?? ()
#16 0x8057a79 in ?? ()
#17 0x8057a45 in ?? ()
#18 0x80496e8 in ?? ()
#19 0x8057a79 in ?? ()
#20 0x8057a45 in ?? ()
#21 0x80496e8 in ?? ()
#22 0x8057a79 in ?? ()
#23 0x8057a45 in ?? ()
#24 0x80496e8 in ?? ()
#25 0x8049aa0 in ?? () 
#26 0x804fd0f in ?? ()
#27 0x80480e9 in ?? ()
(kgdb) frame 5 
#5  0xf019b62f in ufs_lookup (ap=0xf7c46dcc) at ../../ufs/ufs/ufs_lookup.c:238
238 ep = (struct direct *)((char *)bp-b_data + entryoffseti
nblock);
(kgdb) l
233  * Full validation checks are slow, so we only check
234  * enough to insure forward progress through the
235  * directory. Complete checks can be run by patching
236  * dirchk to be true.
237  */
238 ep = (struct direct *)((char *)bp-b_data + entryoffseti
nblock);
239 if (ep-d_reclen == 0 ||
240 (dirchk  ufs_dirbadentry(vdp, ep, entryoffsetinblo
ck))) {
241 int i;
242 
(kgdb) printf %p + %d\n, bp-b_data, entryoffset^Ht^Ginblock
0xf3743000 + 21209
(kgdb) printf %d: %s\n, p-p_pid ^H ^H, p-p_comm
68863: make 
#relevant code:
bmask = VFSTOUFS(vdp-v_mount)-um_mountp-mnt_stat.f_iosize - 1;
if (nameiop != LOOKUP || dp-i_diroff == 0 ||
dp-i_diroff  dp-i_size) {
entryoffsetinblock = 0;
dp-i_offset = 0; 
numdirpasses = 1;
} else {
dp-i_offset = dp-i_diroff;
if ((entryoffsetinblock = dp-i_offset  bmask) 
(error = UFS_BLKATOFF(vdp, (off_t)dp-i_offset, NULL, bp)))
return (error);
numdirpasses = 2;
nchstats.ncs_2passes++;
}
(kgdb) printf i_offset %d  bmask %d = %d\n, 

Re: trap in ufs_lookup

1999-01-15 Thread Luoqi Chen
I'm pretty sure this is not softupdates related. It could either be bad RAM
or a bad disk block, there is no way entryoffsetinblock could be 21209,
the block size is only 8192. And you need over 2000 files to fill the
directory to i_offset == 37593, assuming an average file name length of
10 bytes.

-lq

I've got a crash in ufs_lookup, and I'm trying to assess responsibility. I
 use SoftUpdates on all drives and _MAY_ have some bad RAM. This crash was
 during a make -j4 -DNOCLEAN world, and maybe it may be due to SoftUpdates not
 completely having finished the dir, but I'm thinking it could've been RAM
 corruption. Someone help me :)
 
 GDB is free software and you are welcome to 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.
 GDB 4.16 (i386-unknown-freebsd),
 Copyright 1996 Free Software Foundation, Inc...
 IdlePTD 2899968
 initial pcb at 2425ec
 panicstr: vm_fault: fault on nofault entry, addr: f3748000
 panic messages:
 --- 
 panic: vm_fault: fault on nofault entry, addr: f3748000
   
 syncing disks... 234 232 223 198 167 150 123 92 63 19 11 1 1 1 1 1 1 1 1 1 
 givin
 g up  
   
 dumping to dev 30001, offset 40960
 dump 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  boot (howto=256) at ../../kern/kern_shutdown.c:285
 285 dumppcb.pcb_cr3 = rcr3();
 (kgdb) bt
 #0  boot (howto=256) at ../../kern/kern_shutdown.c:285
 #1  0xf01383d5 in panic (
 fmt=0xf0211d86 vm_fault: fault on nofault entry, addr: %lx)
 at ../../kern/kern_shutdown.c:446
 #2  0xf01a297e in vm_fault (map=0xf025e014, vaddr=4084498432,
 fault_type=1 '\001', fault_flags=0) at ../../vm/vm_fault.c:232
 #3  0xf01da750 in trap_pfault (frame=0xf7c46cd0, usermode=0, eva=4084499165)
 at ../../i386/i386/trap.c:824
 #4  0xf01da3f2 in trap (frame={tf_es = 16, tf_ds = 16, tf_edi = 21209,
   tf_esi = -247132928, tf_ebp = -138121840, tf_isp = -138121992,
   tf_ebx = -210468135, tf_edx = -222954112, tf_ecx = 8191, tf_eax = 
 37593,  
   tf_trapno = 12, tf_err = 0, tf_eip = -266750417, tf_cs = 8,
   tf_eflags = 66178, tf_esp = -138278720, tf_ss = -138121524})
 at ../../i386/i386/trap.c:437 
 #5  0xf019b62f in ufs_lookup (ap=0xf7c46dcc) at 
 ../../ufs/ufs/ufs_lookup.c:238 
 #6  0xf01a03e9 in ufs_vnoperate (ap=0xf7c46dcc) 
 at ../../ufs/ufs/ufs_vnops.c:2294
 #7  0xf0157f30 in vfs_cache_lookup (ap=0xf7c46e28) at vnode_if.h:55
 #8  0xf01a03e9 in ufs_vnoperate (ap=0xf7c46e28)
 at ../../ufs/ufs/ufs_vnops.c:2294
 #9  0xf015a405 in lookup (ndp=0xf7c46ea8) at vnode_if.h:31
 #10 0xf0159ed8 in namei (ndp=0xf7c46ea8) at ../../kern/vfs_lookup.c:152
 #11 0xf015f5a0 in stat (p=0xf7b8b3c0, uap=0xf7c46f84)
 ---Type return to continue, or q return to quit---
 at ../../kern/vfs_syscalls.c:1614
 #12 0xf01dad47 in syscall (frame={tf_es = 39, tf_ds = 39, tf_edi = 136292736,
   tf_esi = 0, tf_ebp = -272644404, tf_isp = -138121260,
   tf_ebx = 134749056, tf_edx = 12, tf_ecx = 134749056, tf_eax = 188,
   tf_trapno = 12, tf_err = 2, tf_eip = 134580048, tf_cs = 31,
   tf_eflags = 582, tf_esp = -272644524, tf_ss = 39})
 at ../../i386/i386/trap.c:1100
 #13 0xf01cd85c in Xint0x80_syscall ()
 #14 0x8050303 in ?? ()
 #15 0x8049761 in ?? ()
 #16 0x8057a79 in ?? ()
 #17 0x8057a45 in ?? ()
 #18 0x80496e8 in ?? ()
 #19 0x8057a79 in ?? ()
 #20 0x8057a45 in ?? ()
 #21 0x80496e8 in ?? ()
 #22 0x8057a79 in ?? ()
 #23 0x8057a45 in ?? ()
 #24 0x80496e8 in ?? ()
 #25 0x8049aa0 in ?? () 
 #26 0x804fd0f in ?? ()
 #27 0x80480e9 in ?? ()
 (kgdb) frame 5 
 #5  0xf019b62f in ufs_lookup (ap=0xf7c46dcc) at ../../ufs/ufs/ufs_lookup.c:238
 238 ep = (struct direct *)((char *)bp-b_data + 
 entryoffseti
 nblock);
 (kgdb) l
 233  * Full validation checks are slow, so we only check
 234  * enough to insure forward progress through the
 235  * directory. Complete checks can be run by patching
 236  * dirchk to be true.
 237  */
 238 ep = (struct direct *)((char *)bp-b_data + 
 entryoffseti
 nblock);
 239 if (ep-d_reclen == 0 ||
 240 (dirchk  ufs_dirbadentry(vdp, ep, 
 entryoffsetinblo
 ck))) {
 241 int i;
 242 
 (kgdb) printf %p + %d\n, bp-b_data, entryoffset^Ht^Ginblock
 0xf3743000 + 21209
 (kgdb) printf %d: %s\n, p-p_pid ^H ^H, p-p_comm
 68863: make 
 #relevant code:
 bmask = VFSTOUFS(vdp-v_mount)-um_mountp-mnt_stat.f_iosize - 1;
 if (nameiop != LOOKUP || dp-i_diroff == 0 ||
 dp-i_diroff  dp-i_size) {
 entryoffsetinblock = 0;