diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2017-09-13 10:34:31 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2017-09-13 10:34:31 +0000 |
commit | 8ac2314e0095869393e0fa91f47b90d1a64ca062 (patch) | |
tree | a1ee5db064b7ea0c886c3fda6c89bc8392b946d8 | |
parent | a345c0b23bf73b7393a0158a6f8646b099dcdf13 (diff) | |
parent | af2da9fb2e2232c7f096cf875f42640edc9c018a (diff) | |
download | src-8ac2314e0095869393e0fa91f47b90d1a64ca062.tar.gz src-8ac2314e0095869393e0fa91f47b90d1a64ca062.zip |
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 <mahrens@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Rich Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>
MFC after: 4 weeks
Notes
Notes:
svn path=/head/; revision=323528
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzpool/common/kernel.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c index 701f0b43bf84..ab1b839975ab 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c +++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c @@ -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 |