Mail Archives: djgpp/2001/04/11/05:24:46
> Date: Tue, 10 Apr 2001 20:08:03 -0700
> From: Daniel Taupin <taupin AT lps DOT u-psud DOT fr>
>
> Finally, I find out thet locate.exe works perfectly... when the
> database is not too big. In fact, when I run
>
> updatedb c:/ (where c: is a 34 Gigabyte disk with a lot of files)
>
> then locate crashes with a page fault. But, when I run updatedb on a
> limited number of files, it runs OK.
FWIW, I have a locatedb.dat file for a total of 26GB of disk space,
and locate doesn't crash for me. The size of my database is about
300KB.
It is possible that the updatedb.bat batch file somehow creates a
corrupted database. Could it be that one of the programs in the pipe
which updatedb runs creates a temporary file that is larger than 2GB,
or that your TMPDIR directory runs out of free space during the
database creation?
> Anyway, the *char value read_pos is incremented WITHOUT any check in
> getline.c, so that if for some reason ia line is huge, the crash is very
> likely.
I believe this observation is false: the function called by locate,
getstr, reads until it sees a delimiter, which in this case is a null
character, '\0'. getstr also gets passed the number of characters
available in the buffer where it puts the characters it reads, and
reallocates that storage to grow the buffer as needed. So I don't see
any obvious bug here.
Stepping with a debugger inside getstr should reveal the real reason
for the crash. Looking at the file pointer position at the moment of
crash might also help, by pointing to a place in locatedb.dat which
causes trouble.
- Raw text -