Subject: kern/25791: Panic during unmount
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <bsd@allegory.demon.co.uk>
List: netbsd-bugs
Date: 06/02/2004 20:58:53
>Number:         25791
>Category:       kern
>Synopsis:       Panic during unmount
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 02 19:59:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Bob
>Release:        NetBSD 2.0_BETA
>Organization:
	
>Environment:
	    @(#)NetBSD 2.0_BETA (TENEBRES) #0: Wed Jun  2 02:08:31 BST 2004
	    Architecture: i386
	    Machine: i386
>Description:

In single user mode, I typed "umount -a" and it panicked.
This is easily repeatable and applied to 2.0E.
See also PR port-i386/25581: Kernel panic unmounting partitions

The laptop can't run any version of -current after IP Filter was upgraded.
I have a copy of both kernel and core dump.
The filesystems all seem to be fine -- "fsck -n -f" doesn't complain.

The laptop is currently running
    NetBSD tenebres.loc 1.6ZL NetBSD 1.6ZL (TENEBRES) #0: Sat Mar 27 02:04:18 GMT 2004

The 2.0_BETA source code dates from "Mon May 31 01:21:40 BST 2004" according to sup/when.allsrc


    (gdb) target kcore netbsd.1.core
    panic: kernel %sassertion "%s" failed: file "%s", line %d
    #0  0x00000001 in ?? ()
    (gdb) where
    #0  0x00000001 in ?? ()
    #1  0xc026cbcb in cpu_reboot (howto=256, bootstr=0x0)
	at ../../../../arch/i386/i386/machdep.c:743
    #2  0xc01c074c in db_sync_cmd (addr=1, have_addr=0, count=-1070934658, 
	modif=0xcb0c3958 "`Ó;Ào9\fË\001") at ../../../../ddb/db_command.c:750
    #3  0xc01c019b in db_command (last_cmdp=0xc035f194, cmd_table=0xc030eb00)
	at ../../../../ddb/db_command.c:464
    #4  0xc01bfeae in db_command_loop () at ../../../../ddb/db_command.c:255
    #5  0xc01c2f78 in db_trap (type=1, code=0) at ../../../../ddb/db_trap.c:101
    #6  0xc026a346 in kdb_trap (type=1, code=0, regs=0xcb0c3bac)
	at ../../../../arch/i386/i386/db_interface.c:225
    #7  0xc02773c3 in trap (frame=0xcb0c3bac)
	at ../../../../arch/i386/i386/trap.c:284
    #8  0xc0102d89 in calltrap ()
    #9  0xc01fd731 in panic (
	fmt=0xc0358dc0 "kernel %sassertion \"%s\" failed: file \"%s\", line %d")
	at ../../../../kern/subr_prf.c:226
    #10 0xc02f775c in __assert (t=0xc0324b25 "diagnostic ", 
	f=0xc033d8c0 "../../../../ufs/ffs/ffs_softdep.c", l=5146, 
	e=0xc0327c2d "vp != NULL") at ../../../../../../lib/libkern/__assert.c:47
    #11 0xc01b2c9c in flush_inodedep_deps (fs=0xc0dd3000, ino=124)
	at x86/intr.h:168
    #12 0xc01b2482 in softdep_sync_metadata (v=0xcb0c3d94)
    ---Type <return> to continue, or q <return> to quit---
	at ../../../../ufs/ffs/ffs_softdep.c:4899
    #13 0xc01b82bc in ffs_full_fsync (v=0xcb0c3d94)
	at ../../../../ufs/ffs/ffs_vnops.c:425
    #14 0xc01b7f60 in ffs_fsync (v=0xcb0c3d94)
	at ../../../../ufs/ffs/ffs_vnops.c:260
    #15 0xc0226f6c in VOP_FSYNC (vp=0xcb0133f0, cred=0xc0ca1e80, flags=1, offlo=0, 
	offhi=0, p=0xcafb6b2c) at ../../../../kern/vnode_if.c:661
    #16 0xc01b61d4 in ffs_flushfiles (mp=<incomplete type>, flags=0, p=0xcafb6b2c)
	at ../../../../ufs/ffs/ffs_vfsops.c:1194
    #17 0xc01ab633 in softdep_flushfiles (oldmnt=0xc0dee200, flags=0, p=0xcafb6b2c)
	at ../../../../ufs/ffs/ffs_softdep.c:933
    #18 0xc01b6163 in ffs_unmount (mp=<incomplete type>, mntflags=0, p=0xcafb6b2c)
	at ../../../../ufs/ffs/ffs_vfsops.c:1105
    #19 0xc0220d61 in dounmount (mp=<incomplete type>, flags=0, p=0xcafb6b2c)
	at ../../../../kern/vfs_syscalls.c:548
    #20 0xc0220c56 in sys_unmount (l=0xcaf8d8c4, v=0xcb0c3f64, retval=0xcb0c3f5c)
	at ../../../../kern/vfs_syscalls.c:491
    #21 0xc0276db2 in syscall_plain (frame=0xcb0c3fa8)
	at ../../../../arch/i386/i386/syscall.c:156

>How-To-Repeat:
    Boot 2.0_BETA in single user mode
    mount -u /
    mount /altroot	## my real root
    cp -p /altroot/bin/tcsh /bin
    sync
    sync
    umount -a		## BANG!

    Due to this bug, I can't use -current since the ipf upgrade (including 2.0_BETA)
    but previous versions run like a dream so h/w faults seem unlikely.

    If you need more data, let me know.
    You can have the kernel and/or core dump if they're useful.

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