INN 2.4.0 core dumps
Alex Kiernan
alexk at demon.net
Wed Feb 21 06:19:00 UTC 2001
Russ Allbery <rra at stanford.edu> writes:
> Alexey Luckyanchikov <alexl at alkar.net> writes:
>
> > I tried to install latest inn from CVS. After 10-15 minutes innd crash:
>
> Whoops, I made a stupid mistake in integrating the timer code. Try this
> patch, which I'm committing now.
>
The summary labellings a bit confused, this seems to fix it up:
Index: lib/timer.c
===================================================================
RCS file: /upstream-repositories/inn-cvs.isc.org/inn/lib/timer.c,v
retrieving revision 1.5
diff -u -r1.5 timer.c
--- lib/timer.c 2001/02/20 19:27:24 1.5
+++ lib/timer.c 2001/02/21 06:04:16
@@ -268,6 +268,19 @@
/*
+** Return the label associated with timer number id. Used internally
+** to do the right thing when fetching from the timer_name or labels
+** arrays
+*/
+static const char *
+tmr_label(const char *const *labels, unsigned int id)
+{
+ return (id >= TMR_APPLICATION) ?
+ labels[id - TMR_APPLICATION] : timer_name[id];
+}
+
+
+/*
** Recursively summarize a single timer tree into the supplied buffer,
** returning the number of characters added to the buffer.
*/
@@ -283,12 +296,14 @@
snprintf semantics, it's safe to defer checking for overflow until
after formatting all of the timer data. */
for (node = timer; node != NULL; node = node->parent)
- off += snprintf(buf + off, len - off, "%s/", labels[node->id]);
+ off += snprintf(buf + off, len - off, "%s/",
+ tmr_label(labels, node->id));
off--;
off += snprintf(buf + off, len - off, " %lu(%lu) ", timer->total,
timer->count);
if (off == len) {
- warn("timer log too long while processing %s", labels[timer->id]);
+ warn("timer log too long while processing %s",
+ tmr_label(labels, timer->id));
return 0;
}
--
Alex Kiernan, Principal Engineer, Development, Thus PLC
More information about the inn-workers
mailing list