From owner-svn-src-head@freebsd.org Wed Sep 13 10:34:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38CFCE19447; Wed, 13 Sep 2017 10:34:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0217681A4A; Wed, 13 Sep 2017 10:34:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8DAYWBw059845; Wed, 13 Sep 2017 10:34:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8DAYWLg059844; Wed, 13 Sep 2017 10:34:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709131034.v8DAYWLg059844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 Sep 2017 10:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323528 - head/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Commit-Revision: 323528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2017 10:34:33 -0000 Author: avg Date: Wed Sep 13 10:34:31 2017 New Revision: 323528 URL: https://svnweb.freebsd.org/changeset/base/323528 Log: MFV r323527: 5815 libzpool's panic function doesn't set global panicstr, ::status not as useful illumos/illumos-gate@fae6347731c9d3f46b26338313b0422927f29cf6 https://github.com/illumos/illumos-gate/commit/fae6347731c9d3f46b26338313b0422927f29cf6 https://www.illumos.org/issues/5815 When panic() is called from within ztest, the mdb ::status command isn't as useful as it could be since the global panicstr variable isn't updated. We should modify the function to make sure panicstr is set, so ::status can present the error message just like it does on a failed assertion. Reviewed by: Matthew Ahrens Reviewed by: Sebastien Roy Reviewed by: Gordon Ross Reviewed by: Rich Lowe Approved by: Dan McDonald Author: Prakash Surya MFC after: 4 weeks Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Sep 13 10:33:09 2017 (r323527) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Sep 13 10:34:31 2017 (r323528) @@ -735,11 +735,9 @@ static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n" void vpanic(const char *fmt, va_list adx) { - (void) fprintf(stderr, "error: "); - (void) vfprintf(stderr, fmt, adx); - (void) fprintf(stderr, "\n"); - - abort(); /* think of it as a "user-level crash dump" */ + char buf[512]; + (void) vsnprintf(buf, 512, fmt, adx); + assfail(buf, NULL, 0); } void