Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2013 04:40:40 GMT
From:      Kurt Lidl <lidl@pix.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/184985: gmirror panic on deactivated mirror
Message-ID:  <201312190440.rBJ4eeT6092920@oldred.freebsd.org>
Resent-Message-ID: <201312190450.rBJ4o0CI058988@freefall.freebsd.org>

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

>Number:         184985
>Category:       kern
>Synopsis:       gmirror panic on deactivated mirror
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 19 04:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Kurt Lidl
>Release:        9.2-RELEASE / 10.0-RC2
>Organization:
>Environment:
FreeBSD b524-fbsd10rc2.pix.net 10.0-RC2 FreeBSD 10.0-RC2 #0 r259404: Sun Dec 15 08:18:20 UTC 2013     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

FreeBSD b524-fbsd9_2.pix.net 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
I have verified the following problem on both a virtual machine running 9.2-RELEASE,
as well as a virtual machine running 10.0-RC2.  (This problem was originally spotted
on a real machine, but it's been narrowed down using just virtual machines.)

The machine panics when 'gmirror status' is run after a gmirror is completely
deactivated.

The machine MUST have >1 CPU for the panic to occur.  With only a single processor on
the machine, the panic will not occur.

Panic looks like this under 10.0-RC2:
root@b524-fbsd10rc2:/var/crash # kgdb /boot/kernel/kernel vmcore.0
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 "amd64-marcel-freebsd"...

Unread portion of the kernel message buffer:
GEOM_MIRROR: Device scratch: provider ada0p3 disconnected.
GEOM_MIRROR: Device scratch: provider mirror/scratch destroyed.
GEOM_MIRROR: Device scratch destroyed.


Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 01
fault virtual address	= 0x378
fault code		= supervisor read data, page not present
instruction pointer	= 0x20:0xffffffff808b78c6
stack pointer	        = 0x28:0xfffffe001ddfea10
frame pointer	        = 0x28:0xfffffe001ddfeab0
code segment		= base 0x0, limit 0xfffff, type 0x1b
			= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags	= interrupt enabled, resume, IOPL = 0
current process		= 13 (g_event)
trap number		= 12
panic: page fault
cpuid = 1
KDB: stack backtrace:
#0 0xffffffff808e7d60 at kdb_backtrace+0x60
#1 0xffffffff808af845 at panic+0x155
#2 0xffffffff80c8e612 at trap_fatal+0x3a2
#3 0xffffffff80c8e8e9 at trap_pfault+0x2c9
#4 0xffffffff80c8e076 at trap+0x5e6
#5 0xffffffff80c75312 at calltrap+0x8
#6 0xffffffff808b7442 at _sx_xlock+0x62
#7 0xffffffff81a371bf at g_mirror_dumpconf+0x12f
#8 0xffffffff8081a35c at g_conf_specific+0x14c
#9 0xffffffff8081acd6 at g_run_events+0x166
#10 0xffffffff8088191a at fork_exit+0x9a
#11 0xffffffff80c7584e at fork_trampoline+0xe
Uptime: 33s
Dumping 78 out of 487 MB:..21%..41%..61%..82%

Reading symbols from /boot/kernel/zfs.ko.symbols...done.
Loaded symbols for /boot/kernel/zfs.ko.symbols
Reading symbols from /boot/kernel/opensolaris.ko.symbols...done.
Loaded symbols for /boot/kernel/opensolaris.ko.symbols
Reading symbols from /boot/kernel/geom_mirror.ko.symbols...done.
Loaded symbols for /boot/kernel/geom_mirror.ko.symbols
#0  doadump (textdump=<value optimized out>) at pcpu.h:219
219	pcpu.h: No such file or directory.
	in pcpu.h
(kgdb) bt
#0  doadump (textdump=<value optimized out>) at pcpu.h:219
#1  0xffffffff808af4c0 in kern_reboot (howto=260)
    at /usr/src/sys/kern/kern_shutdown.c:447
#2  0xffffffff808af884 in panic (fmt=<value optimized out>)
    at /usr/src/sys/kern/kern_shutdown.c:754
#3  0xffffffff80c8e612 in trap_fatal (frame=<value optimized out>, 
    eva=<value optimized out>) at /usr/src/sys/amd64/amd64/trap.c:882
#4  0xffffffff80c8e8e9 in trap_pfault (frame=0xfffffe001ddfe960, usermode=0)
    at /usr/src/sys/amd64/amd64/trap.c:699
#5  0xffffffff80c8e076 in trap (frame=0xfffffe001ddfe960)
    at /usr/src/sys/amd64/amd64/trap.c:463
#6  0xffffffff80c75312 in calltrap ()
    at /usr/src/sys/amd64/amd64/exception.S:232
#7  0xffffffff808b78c6 in _sx_xlock_hard (sx=0xfffff80018321240, 
    tid=18446735277652013056, opts=<value optimized out>, 
    file=0x2beff0 <Address 0x2beff0 out of bounds>, line=0)
    at /usr/src/sys/kern/kern_sx.c:556
#8  0xffffffff808b7442 in _sx_xlock (sx=0x2beff0, opts=0, 
    file=<value optimized out>, line=2879472) at sx.h:152
#9  0xffffffff81a371bf in g_mirror_dumpconf (sb=0xfffff80018310540, 
    indent=0xffffffff80ea9f7d "\t", gp=<value optimized out>, 
    cp=<value optimized out>, pp=<value optimized out>)
    at /usr/src/sys/modules/geom/geom_mirror/../../../geom/mirror/g_mirror.c:320---Type <return> to continue, or q <return> to quit--- 
2
#10 0xffffffff8081a35c in g_conf_specific (sb=0xfffff80018310540, mp=0x0, 
    gp=0x0, pp=0x0, cp=0x0) at /usr/src/sys/geom/geom_dump.c:238
#11 0xffffffff8081acd6 in g_run_events () at /usr/src/sys/geom/geom_event.c:257
#12 0xffffffff8088191a in fork_exit (
    callout=0xffffffff8081c8e0 <g_event_procbody>, arg=0x0, 
    frame=0xfffffe001ddfec00) at /usr/src/sys/kern/kern_fork.c:995
#13 0xffffffff80c7584e in fork_trampoline ()
    at /usr/src/sys/amd64/amd64/exception.S:606
#14 0x0000000000000000 in ?? ()
Current language:  auto; currently minimal
(kgdb) 

>How-To-Repeat:
Assuming, an unused partition on /dev/ada0p3:

while :
do
  gmirror label -v scratch /dev/ada0p3
  newfs /dev/mirror/scratch
  mount /dev/mirror/scratch /mnt
  umount -f /mnt
  gmirror deactivate scratch /dev/ada0p3
  gmirror status scratch
done

The machine will panic on the final 'gmirror status scratch' command.
This happens 100% of the time on the first run through the loop on 9.2-RELEASE.
On 10.0-RC2, it may take two or three iterations of the loop before the panic.

>Fix:


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



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