kernel panic caused by zfs/sa.c

Mikael Fridh frimik at
Sun Aug 12 11:03:10 UTC 2012

On Thu, Jul 19, 2012 at 11:36 PM, Olivier Smedts <olivier at> wrote:
> 2012/7/19 Greg Bonett <greg at>:
>> Hello,
>> I'm experiencing a kernel panic that appears to be caused by zfs.
>> No errors are making it into /var/log/messages, but here is the error
>> message that appears on my screen after panic (transcribed):
>> panic solaris assert BSWAP_32(sa_hdr_phys->sa_magic) == SA_MAGIC,
>> file: /src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c, line 1262

Happening pretty much daily.
This was previously an old 8.2 patched with an early zpool v28.
Recently upgraded it to 9.0.

I guess next I will attempt recreating all filesystems... if it's as
you say -- a filesystem problem and not caused by hardware issues... dumped core - see /var/crash/vmcore.9

Sat Aug 11 11:28:55 CEST 2012

FreeBSD 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #1:
Mon Jul 16 22:59:11 CEST 2012
root at  amd64

panic: solaris assert: BSWAP_32(sa_hdr_phys->sa_magic) == SA_MAGIC,
file: /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c,
line: 1262

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:
panic: solaris assert: BSWAP_32(sa_hdr_phys->sa_magic) == SA_MAGIC,
file: /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c,
line: 1262
cpuid = 0
KDB: stack backtrace:
#0 0xffffffff808680fe at kdb_backtrace+0x5e
#1 0xffffffff80832cb7 at panic+0x187
#2 0xffffffff8141fb8e at sa_build_index+0x2ee
#3 0xffffffff8141fc65 at sa_handle_get_from_db+0xd5
#4 0xffffffff8144c8f1 at zfs_znode_sa_init+0xd1
#5 0xffffffff8144d93a at zfs_znode_alloc+0xba
#6 0xffffffff8144df5f at zfs_zget+0x2af
#7 0xffffffff81462f48 at zfs_dirent_lock+0x488
#8 0xffffffff814631d9 at zfs_dirlook+0x69
#9 0xffffffff8147346b at zfs_lookup+0x26b
#10 0xffffffff81473cc1 at zfs_freebsd_lookup+0x81
#11 0xffffffff808b2be3 at vfs_cache_lookup+0xf3
#12 0xffffffff80b7dbb0 at VOP_LOOKUP_APV+0x40
#13 0xffffffff808b9fa4 at lookup+0x464
#14 0xffffffff808bb056 at namei+0x4d6
#15 0xffffffff808cadf3 at kern_statat_vnhook+0xb3
#16 0xffffffff808cafb5 at kern_statat+0x15
#17 0xffffffff808cb07a at sys_lstat+0x2a
Uptime: 18h15m30s
Dumping 1739 out of 3306 MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%

Reading symbols from /boot/kernel/zfs.ko...Reading symbols from
Loaded symbols for /boot/kernel/zfs.ko
Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols
from /boot/kernel/opensolaris.ko.symbols...done.
Loaded symbols for /boot/kernel/opensolaris.ko
Reading symbols from /boot/kernel/pf.ko...Reading symbols from
Loaded symbols for /boot/kernel/pf.ko
Reading symbols from /usr/local/modules/fuse.ko...done.
Loaded symbols for /usr/local/modules/fuse.ko
#0  doadump (textdump=Variable "textdump" is not available.
) at pcpu.h:224
224	pcpu.h: No such file or directory.
	in pcpu.h
(kgdb) #0  doadump (textdump=Variable "textdump" is not available.
) at pcpu.h:224
#1  0xffffffff808327f5 in kern_reboot (howto=260)
    at /usr/src/sys/kern/kern_shutdown.c:442
#2  0xffffffff80832ca1 in panic (fmt=Variable "fmt" is not available.
    at /usr/src/sys/kern/kern_shutdown.c:607
#3  0xffffffff8141fb8e in sa_build_index (hdl=Variable "hdl" is not available.
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c:1262
#4  0xffffffff8141fc65 in sa_handle_get_from_db (os=0xfffffe0007619400,
    db=0xfffffe000ef8fd20, userp=0xfffffe00b016d4b0, hdl_type=Variable
"hdl_type" is not available.
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c:1367
#5  0xffffffff8144c8f1 in zfs_znode_sa_init (zfsvfs=0xfffffe00074f6000,
    zp=0xfffffe00b016d4b0, db=0xfffffe000ef8fd20, obj_type=DMU_OT_SA,
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:601
#6  0xffffffff8144d93a in zfs_znode_alloc (zfsvfs=0xfffffe00074f6000,
    db=0xfffffe000ef8fd20, blksz=Variable "blksz" is not available.
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:683
#7  0xffffffff8144df5f in zfs_zget (zfsvfs=0xfffffe00074f6000,
    obj_num=437071, zpp=0xffffff80fa343498)
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:1247
#8  0xffffffff81462f48 in zfs_dirent_lock (dlpp=0xffffff80fa3434a0,
    dzp=0xfffffe0039fa0960, name=0xffffff80fa343580 "CVS",
    zpp=0xffffff80fa343498, flag=Variable "flag" is not available.
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c:317
#9  0xffffffff814631d9 in zfs_dirlook (dzp=0xfffffe0039fa0960,
    name=0xffffff80fa343580 "CVS", vpp=0xffffff80fa343940,
flags=Variable "flags" is not available.
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c:411
#10 0xffffffff8147346b in zfs_lookup (dvp=0xfffffe0071cdd960,
    nm=0xffffff80fa343580 "CVS", vpp=0xffffff80fa343940,
    cnp=0xffffff80fa343968, nameiop=0, cr=0xfffffe0017432b00,
    td=0xfffffe002725f460, flags=0)
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:1404
#11 0xffffffff81473cc1 in zfs_freebsd_lookup (ap=0xffffff80fa3436c0)
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:5758
#12 0xffffffff808b2be3 in vfs_cache_lookup (ap=Variable "ap" is not available.
) at vnode_if.h:80
#13 0xffffffff80b7dbb0 in VOP_LOOKUP_APV (vop=0xffffffff814e6fc0,
    a=0xffffff80fa3437c0) at vnode_if.c:123
#14 0xffffffff808b9fa4 in lookup (ndp=0xffffff80fa343900) at vnode_if.h:54
#15 0xffffffff808bb056 in namei (ndp=0xffffff80fa343900)
    at /usr/src/sys/kern/vfs_lookup.c:297
#16 0xffffffff808cadf3 in kern_statat_vnhook (td=0xfffffe002725f460,
flag=Variable "flag" is not available.
    at /usr/src/sys/kern/vfs_syscalls.c:2422
#17 0xffffffff808cafb5 in kern_statat (td=Variable "td" is not available.
    at /usr/src/sys/kern/vfs_syscalls.c:2403
#18 0xffffffff808cb07a in sys_lstat (td=Variable "td" is not available.
    at /usr/src/sys/kern/vfs_syscalls.c:2466
#19 0xffffffff80b17e90 in amd64_syscall (td=0xfffffe002725f460, traced=0)
    at subr_syscall.c:131
#20 0xffffffff80b03537 in Xfast_syscall ()
    at /usr/src/sys/amd64/amd64/exception.S:387
#21 0x000000080093ccac in ?? ()
Previous frame inner to this frame (corrupt stack?)

More information about the freebsd-stable mailing list