delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/11/05:24:46

Date: Wed, 11 Apr 2001 12:18:53 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: Daniel Taupin <taupin AT lps DOT u-psud DOT fr>
Message-Id: <2427-Wed11Apr2001121853+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <3AD3CA93.4DA31C76@lps.u-psud.fr> (message from Daniel Taupin on
Tue, 10 Apr 2001 20:08:03 -0700)
Subject: Re: locate.exe
References: <3AD3CA93 DOT 4DA31C76 AT lps DOT u-psud DOT fr>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019