diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2017-09-13 10:33:09 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2017-09-13 10:33:09 +0000 |
commit | af2da9fb2e2232c7f096cf875f42640edc9c018a (patch) | |
tree | 137ad3652854708499d052f6c2f58186ae8dc69b /lib | |
parent | 9c9dc52f25bbfb1a1ca574b83bf4ad0d01661d3f (diff) | |
download | src-af2da9fb2e2232c7f096cf875f42640edc9c018a.tar.gz src-af2da9fb2e2232c7f096cf875f42640edc9c018a.zip |
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>
Notes
Notes:
svn path=/vendor/illumos/dist/; revision=323527
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzpool/common/kernel.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libzpool/common/kernel.c b/lib/libzpool/common/kernel.c index 07f9e53b6670..7000c64a8249 100644 --- a/lib/libzpool/common/kernel.c +++ b/lib/libzpool/common/kernel.c @@ -699,11 +699,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 |