kern/174684: 3dm2 (or smartctl) triggers a kernel panic

Shunsuke Suganuma 3226388001 at jcom.home.ne.jp
Mon Dec 24 15:40:01 UTC 2012


>Number:         174684
>Category:       kern
>Synopsis:       3dm2 (or smartctl) triggers a kernel panic
>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:   Mon Dec 24 15:40:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Shunsuke Suganuma
>Release:        9.1-PRERELEASE
>Organization:
>Environment:
9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #1 r244649M: amd64
with LSI 3ware 9750 SAS/SATA Storage Controller
>Description:
3dm2 or smartmontools(smartctl) with 3ware 9750 (tws driver) triggers a kernel panic, when INVARIANTS/INVARIANT_SUPPORT are set as the kernel option. 

[3dm2]
installed from ports

[smartmontools]
installed from ports
(For supporting tws, I've modified some of the code based on the info obtained here: http://sourceforge.net/apps/trac/smartmontools/ticket/236)


Panic example:
<118>root{/}% smartctl -a --device=3ware,0 /dev/tws0
<118>smartctl 6.0 2012-10-10 r3643 [FreeBSD 9.1-PRERELEASE amd64] (local build)
<118>Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org
<118>
panic: sleepq_signal: invalid NULL wait channel
cpuid = 6
KDB: stack backtrace:
#0 0xffffffff80830bf6 at kdb_backtrace+0x66
#1 0xffffffff807fa558 at panic+0x1d8
#2 0xffffffff8083b1a8 at sleepq_signal+0xf8
#3 0xffffffff80803267 at wakeup_one+0x27
#4 0xffffffff806a907c at tws_ioctl+0x54c
#5 0xffffffff8074f00a at devfs_ioctl_f+0x7a
#6 0xffffffff80844e0f at kern_ioctl+0xcf
#7 0xffffffff8084509d at sys_ioctl+0xfd
#8 0xffffffff80a9e211 at amd64_syscall+0x2d1
#9 0xffffffff80a88d27 at Xfast_syscall+0xf7
Uptime: 5m20s
Dumping 722 out of 16338 MB:..3%..12%..23%..31%..43%..51%..62%..71%..82%..91%

>How-To-Repeat:
1.
build and install the kernel with:
options         INVARIANTS
options         INVARIANT_SUPPORT

2.
install ports/sysutils/3dm 2.11.00.019

3.
run 3dm2 with some appropriate config, then panic.


>Fix:
The following change seems to prevent the panic.
(but I don't know if it's the correct fix for the problem.)


src/sys/dev/tws/tws_user.c:

@L208 in tws_passthru()

[before]
    wakeup_one(sc->chan);

[after]
    if ( sc->chan != NULL ) wakeup_one(sc->chan);


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


More information about the freebsd-bugs mailing list