From nobody@FreeBSD.org  Mon Feb 15 22:17:43 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41EED106568B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 15 Feb 2010 22:17:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 16C0D8FC1D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 15 Feb 2010 22:17:43 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o1FMHgxx057678
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 15 Feb 2010 22:17:42 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o1FMHgWZ057677;
	Mon, 15 Feb 2010 22:17:42 GMT
	(envelope-from nobody)
Message-Id: <201002152217.o1FMHgWZ057677@www.freebsd.org>
Date: Mon, 15 Feb 2010 22:17:42 GMT
From: Charles Owens <cowens@greatbaysoftware.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mptutil(8) segfault
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         143972
>Category:       bin
>Synopsis:       mptutil(8) segfault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 15 22:20:01 UTC 2010
>Closed-Date:    Tue Jul 13 12:28:59 UTC 2010
>Last-Modified:  Tue Jul 13 12:28:59 UTC 2010
>Originator:     Charles Owens
>Release:        8.0-RELEASE-p2
>Organization:
Great Bay Software
>Environment:
FreeBSD beacon 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #2: Thu Feb 11 20:00:47 UTC 2010     cowens@newcastle.greatbaysoftware.com:/usr/obj/usr/src/sys/BEACON  i386

>Description:
(Note:  kernel config is essentially PAE)

This work is being performed on a IBM System x3350 M2.  It has the ServeRAID-BR10i SAS/SATA Controller which is based on the LSI 1068E processor, as described here:
http://www-01.ibm.com/common/ssi/rep_ca/4/872/ENUSAG09-0104/index.html

Initially, the mptutil(8) appeared to work just fine.  We used it to put the storage system through its paces, trying to simulate all stages in a RAID array's life-cycle (volume creation, disk failure & replacement, volume deletion and recreation).  After having gone through these steps several times, behavior abruptly changed.  All invocations of the mptutil command except for "show adapter" and "show volume" now die with segfault.

We've done everything we can think of to try to get the controller/array back to a clean initial state, but to no avail. (This includes using the LSI in-BIOS manager to create/delete volumes -- which in and of itself works fine).  The mptutil command just keeps on segfaulting as described.

Note, if a volume does exist, we can /use/ it just fine (to install/run FreeBSD), so the problem doesn't appear to be directly with the mpt(4) driver itself.

Here's the output of "mptutil show adapter":

mpt0 Adapter:
       Board Name: SR-BR10i
   Board Assembly: L3-25116-01H
        Chip Name: C1068E
    Chip Revision: UNUSED
      RAID Levels: RAID0, RAID1, RAID1E
    RAID0 Stripes: 64K
   RAID1E Stripes: 64K
 RAID0 Drives/Vol: 1-10
 RAID1 Drives/Vol: 2
RAID1E Drives/Vol: 3-10
>How-To-Repeat:
On system with LSI 1068-based controller (or possibly other types of controllers supported by mpt(4)), boot from non-RAID media into context that includes the mptutil(8) command.  This could be a non-RAID hard drive or repair shell using FreeBSD livefs CD or similar.

Use mptutil repeatedly as described to create & delete volumes and list adapter, drive, and volume status.  Try rebooting if need be.  Eventually (if you're lucky) something will go wrong and mptutil will begin dying as described for most forms of usage.
>Fix:


>Release-Note:
>Audit-Trail:

From: Charles Owens <cowens@greatbaysoftware.com>
To: bug-followup@FreeBSD.org, cowens@greatbaysoftware.com
Cc:  
Subject: Re: bin/143972: mptutil(8) segfault
Date: Mon, 19 Apr 2010 19:41:34 -0400

 Issue resolved via patch from John Baldwin (thanks much!). For
 discussion thread see:
 
 http://docs.freebsd.org/cgi/mid.cgi?201002181023.08131.jhb
 
 Patch committed to -CURRENT: 204086 and 204090... already MFC'd.
 
 -- 
 Charles Owens
 Great Bay Software, Inc.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Tue Jul 13 12:28:38 UTC 2010 
State-Changed-Why:  
Submitter reports that this has been fixed and MFC'd. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143972 
>Unformatted:
