Last call for 2.4.3 problems
Heiko Schlichting
inn-workers at cis.fu-berlin.de
Tue Jan 17 22:07:54 UTC 2006
Russ wrote:
> I've been running 2.4.3 for a while on one of my systems, and it seems
> generally okay. I'm therefore planning on making the release official.
> Has anyone else run into any problems?
Except of many warnings about declared but unused variables, I had
- problems compiling the tests on my system (SGI IRIX 6.5.28, MIPSpro
Compiler 7.4.4) due to a bug in the Makefile,
- one unknown timezone in the date test and
- some long standing bugs in the DBZTEST code of dbz.c.
----------------------- compile problems -----------------------------
The first looks like a bug in the Makefile. Here is my suggested fix which
works for me:
--- inn-2.4.3/tests/Makefile.org 2005-12-25 01:30:49.000000000 +0100
+++ inn-2.4.3/tests/Makefile 2006-01-17 21:35:06.341315384 +0100
@@ -61,7 +61,7 @@
lib/hashtab.t: lib/hashtab-t.o libtest.o $(LIBINN)
$(LINK) lib/hashtab-t.o libtest.o $(LIBINN)
-lib/hstrerror.o: ../lib/hstrerror.o
+lib/hstrerror.o: ../lib/hstrerror.c
$(CC) $(CFLAGS) -DTESTING -c -o $@ ../lib/hstrerror.c
lib/hstrerror.t: lib/hstrerror.o lib/hstrerror-t.o libtest.o
----------------------- date.t failed -------------------------------
There is also one failing test but I assume that is because SGI IRIX does
not define the NDT timezone and we can safely ignore this.
$ lib/date.t
94
ok 1
ok 2
ok 3
[...]
ok 16
not ok 17
wanted: Thu, 9 Jul 1998 13:30:45 -0230 (NDT)
seen: Thu, 9 Jul 1998 16:00:45 +0000 (GMT)
ok 18
[...]
------------------- bugs is dbz.c (DBZTEST code) -----------------
There are several bugs in dbz.c if compiled with "-DDBZTEST". They are to
numerous to fix all of them in a small hack but I tried to fix the
hopefully most serious:
- unlink() in RemoveDBZ() deletes wrong file ("%s.exists" instead of
"%s.hash")
- core dump because of using innconf->nfswriter without allocating innconf
- debug() in dbzclose() returns "failed" if it "succeeded" and vice versa.
- RemoveDBZ should use concat()
- dbzstore() is expected to return a negative value if it fails which is
wrong. It does return DBZSTORE_ERROR (enum) which will never be negative.
- line counter is wrong (off by one)
- typo in usage()
These should be fixed by the patch below (not tested extensively). At least
these problems still exists:
- debug output of fetch() is more or less unreadable (binary) and should be
encoded to some ascii format
- debug() function seems to be inconsistent with the function of same name
in messages.c
--- inn-2.4.3/lib/dbz.c.org 2005-12-25 01:30:49.000000000 +0100
+++ inn-2.4.3/lib/dbz.c 2006-01-17 23:00:22.395637869 +0100
@@ -838,7 +838,7 @@
ret = false;
}
- debug("dbzclose: %s", (ret == 0) ? "succeeded" : "failed");
+ debug("dbzclose: %s", (ret == true) ? "succeeded" : "failed");
if (ret)
opendb = false;
return ret;
@@ -1639,27 +1639,36 @@
void
RemoveDBZ(char *filename)
{
- char fn[1024];
+ char *fn;
#ifdef DO_TAGGED_HASH
- snprintf(fn, sizeof(fn), "%s.pag", filename);
+ fn = concat(filename, pag, (char *) 0);
unlink(fn);
+ free(fn);
#else
- snprintf(fn, sizeof(fn), "%s.exists", filename);
+ fn = concat(filename, exists, (char *) 0);
unlink(fn);
- snprintf(fn, sizeof(fn), "%s.index", filename);
+ free(fn);
+ fn = concat(filename, idx, (char *) 0);
unlink(fn);
+ free(fn);
#endif
- snprintf(fn, sizeof(fn), "%s.dir", filename);
+ fn = concat(filename, dir, (char *) 0);
unlink(fn);
+ free(fn);
}
static void
usage(void)
{
- fprintf(stderr, "usage: dbztest [-i] [-n|m] [-s size] <history>\n");
+ fprintf(stderr, "usage: dbztest [-i] [-n|m] [-N] [-s size] <history>\n");
+#ifdef DO_TAGGED_HASH
fprintf(stderr, " -i initialize history. deletes .pag files\n");
- fprintf(stderr, " -n or m use INCORE_NO, INCORE_/MMAP. default = INCORE_MEM\n");
+#else
+ fprintf(stderr, " -i initialize history. deletes .exists and .idx files\n");
+#endif
+ fprintf(stderr, " -n or m use INCORE_NO, INCORE_MMAP. default = INCORE_MEM\n");
+ fprintf(stderr, " -N using nfswriter mode\n");
fprintf(stderr, " -s size number of history lines[2500000]\n");
fprintf(stderr, " history history text file\n");
exit(1);
@@ -1680,11 +1689,16 @@
struct timeval start, end;
off_t ivalue;
+ innconf=xmalloc(sizeof(struct innconf));
+ innconf->nfswriter = false;
+
for (i=1; i<argc; i++)
if (strcmp(argv[i], "-i") == 0)
initialize = 1;
else if (strcmp(argv[i], "-n") == 0)
incore = INCORE_NO;
+ else if (strcmp(argv[i], "-N") == 0)
+ innconf->nfswriter = true;
else if (strcmp(argv[i], "-m") == 0)
#if defined(HAVE_MMAP)
incore = INCORE_MMAP;
@@ -1743,7 +1757,7 @@
else
continue;
if (initialize) {
- if (dbzstore(key, where) < 0) {
+ if (dbzstore(key, where) == DBZSTORE_ERROR) {
fprintf(stderr, "cant store %s\n", ibuf);
exit(1);
}
@@ -1756,6 +1770,7 @@
}
gettimeofday(&end, NULL);
i = timediffms(start, end);
+ line--;
printf("%s: %d lines %.3f msec/id\n",
(initialize) ? "dbzstore" : "dbzfetch",
line, (double)i / (double)line);
Heiko Schlichting | Freie Universität Berlin
heiko at FU-Berlin.DE | Zentraleinrichtung für Datenverarbeitung (ZEDAT)
Telefon +49 30 838-54327 | Fabeckstraße 32
Telefax +49 30 838454327 | 14195 Berlin
More information about the inn-workers
mailing list