On Thu, 15 Mar 2007, Otto Moerbeek wrote:
> On Thu, 15 Mar 2007, Han Boetes wrote:
>
> > Hi,
> >
> > Thanks for your suggestions. Here is what I found. Please let me
> > know if you need more information.
> >
> > This error happens only with the /mnt/mp3 filesystem. Just to make
> > sure it was not a filesystem inconsistency I fsck'ed it. It turned
> > out to be fine.
> >
> > This is what mount returns:
> > /dev/wd1a on /mnt/mp3 type ffs (NFS exported, local, noatime, nodev,
> > nosuid, softdep)
> >
> > And the df output:
> > ~% df -h /mnt/mp3
> > Filesystem Size Used Avail Capacity Mounted on
> > /dev/wd1a 230G 217G 2.0G 99% /mnt/mp3
> >
> > To make debugging that a bit easier I did the following:
> >
> > sudo /usr/libexec/locate.updatedb
> > --searchpath=/mnt/mp3/Klassiek/Schoenberg/PelleasundMelisande
>
> That should be searchpaths with an s.
>
> >
> > which also reproduces the bug.
> >
> > The dirtree looks like this:
> >
> > ~% \ls -l /mnt/mp3/Klassiek/Schoenberg/PelleasundMelisande
> > total 108256
> > -r--r--r-- 1 han nfs 14321130 Oct 7 2003 Schoenberg - Pelleas und
> > Melisande - 01 - Ein wenig bewegt - zogernd.ogg
> > -r--r--r-- 1 han nfs 11406273 Oct 7 2003 Schoenberg - Pelleas und
> > Melisande - 02 - Sehr rasch.ogg
> > -r--r--r-- 1 han nfs 9792736 Oct 7 2003 Schoenberg - Pelleas und
> > Melisande - 03 - Langsam.ogg
> > -r--r--r-- 1 han nfs 19796656 Oct 7 2003 Schoenberg - Pelleas und
> > Melisande - 04 - Sehr langsam.ogg
> >
> > And /var/db/locate.database base64 encoded looks like this:
> >
> > LXVuc2FvZ2hyZ2dlbmVsY2hhc2FuU2UvbS5vem90c3Nzcm5yZ3Azb2VudG5nbmRuYm0ubGxs
> > aWxlbGFrL2lzaW5pZ2llaG9nc2dlZ2V3ZXJlZ2VhZWRlZE1kLmRiZWFtU2NQZU1lTGE0MzIw
> > MS9TL1AvS3dybGJFLQ4vbW50L21wMy9LbGGPaWVrL7Bob5SuhC9QnGxlYXN1bmRNnGlzYW5k
> > ZR4+AAAAL1NjaG9lbmKnZyAtILGaqXMgdW5kILJsaYluZGUgLSAwMSAtIEVpbiB3lGlnIGKm
> > qHQgLSB6b4VybmQuo2ceNQAAADIgLSBTZWhyIHJhc2NoLm9nZw4zIC0gs25niYyjZw40IC0g
> > U2VociBsYW5nc68ub2dn
> >
> > I checked the md5 of the file which you get if you save this code
> > to a file and run it through base64 -e and it's the same.
>
> I recreated the dir tree here, and I can reproduce your problem. I
> have to find out if the trouble is in generating the database or
> reading it.
>
> -Otto
The problem is here that the amount of data is too little to build a
complete bigram table. The situation is detected by the diff below.
Did you also experience problems when indexing more files?
-Otto
Index: locate.code.c
===================================================================
RCS file: /cvs/src/usr.bin/locate/code/locate.code.c,v
retrieving revision 1.14
diff -u -p -r1.14 locate.code.c
--- locate.code.c 19 Feb 2007 20:01:12 -0000 1.14
+++ locate.code.c 15 Mar 2007 09:25:18 -0000
@@ -149,6 +149,9 @@ main(int argc, char *argv[])
if (fgets(bigrams, sizeof(bigrams), fp) == NULL)
err(1, "fgets");
+ if (strlen(bigrams) != BGBUFSIZE)
+ errx(1, "bigram array too small to build db, index more files");
+
if (fputs(bigrams, stdout) == EOF)
err(1, "stdout");
(void)fclose(fp);