Commit a223fc29 authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Tweak the panic string, and document how to extract it post-mortem.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2303 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent f8579389
...@@ -37,7 +37,12 @@ ...@@ -37,7 +37,12 @@
#ifndef WITHOUT_ASSERTS #ifndef WITHOUT_ASSERTS
/* panic string */ /*
* The panic string is constructed in memory, then printed to stderr. It
* can be extracted post-mortem from a core dump using gdb:
*
* (gdb) printf "%s", panicstr
*/
char panicstr[65536]; char panicstr[65536];
static char *pstr = panicstr; static char *pstr = panicstr;
...@@ -67,8 +72,9 @@ dump_storage(const struct storage *st) ...@@ -67,8 +72,9 @@ dump_storage(const struct storage *st)
#define MAX_BYTES (4*16) #define MAX_BYTES (4*16)
#define show(ch) (((ch) > 31 && (ch) < 127) ? (ch) : '.') #define show(ch) (((ch) > 31 && (ch) < 127) ? (ch) : '.')
fp(" %u {\n", st->len);
for (i = 0; i < MAX_BYTES && i < st->len; i += 16) { for (i = 0; i < MAX_BYTES && i < st->len; i += 16) {
fp(" "); fp(" ");
for (j = 0; j < 16; ++j) { for (j = 0; j < 16; ++j) {
if (i + j < st->len) if (i + j < st->len)
fp("%02x ", st->ptr[i + j]); fp("%02x ", st->ptr[i + j]);
...@@ -82,7 +88,8 @@ dump_storage(const struct storage *st) ...@@ -82,7 +88,8 @@ dump_storage(const struct storage *st)
fp("|\n"); fp("|\n");
} }
if (st->len > MAX_BYTES) if (st->len > MAX_BYTES)
fp(" [%u more]\n", st->len - MAX_BYTES); fp(" [%u more]\n", st->len - MAX_BYTES);
fp(" },\n");
#undef show #undef show
#undef MAX_BYTES #undef MAX_BYTES
...@@ -115,6 +122,7 @@ dump_object(const struct object *o) ...@@ -115,6 +122,7 @@ dump_object(const struct object *o)
fp(" obj = %p {\n", o); fp(" obj = %p {\n", o);
fp(" refcnt = %u, xid = %u,\n", o->refcnt, o->xid); fp(" refcnt = %u, xid = %u,\n", o->refcnt, o->xid);
dump_http(o->http); dump_http(o->http);
fp(" len = %u,\n", o->len);
fp(" store = {\n"); fp(" store = {\n");
VTAILQ_FOREACH(st, &o->store, list) { VTAILQ_FOREACH(st, &o->store, list) {
dump_storage(st); dump_storage(st);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment