[plug] updatedb & locate

Craig Ringer craig at postnewspapers.com.au
Tue Jun 24 22:54:47 WST 2003


>
>
>When my updatedb completes and I try to use locate I seem
>to get a Segmentation fault??
>Sometimes I get results as well but others just the fault.
>
Interesting. Only locate?  Have you tried "ldd `which locate`" to see if 
it's linking to any unexpected libraries (say, something installed in 
/usr/local/lib)?

Maybe run "strace locate" and see if you can make any sense of the 
output. You'll want to redirect stderr to a file (under bash, "strace 
2>/tmp/trace locate" will do it). This produces a lot of output and can 
be hard to follow, but can be an important debugging tool for figuring 
out what's going wrong.

Alternately - more info please. Distro and version, in particular.

>grail at Coven:~$ locate grep
>/bin/zgrep
>/etc/sorcery/local/depends/grep
>Segmentation fault
>  
>
Interesting that it segfaults after producing some results. Doesn't look 
like that's all the output, either - it should be reporting /bin/grep, 
/bin/egrep, /bin/fgrep, etc as well.

Have you tried deleting your locatedb and then running updatedb? 
Alternately, is this old-style locate or slocate? If it's the old one - 
well, that's your chance to upgrade then isn't it ;-)

The existance of /etc/sorcery suggests your're using ... what was it? 
Sourceror linux? In which case, you've probably built everything from 
scratch. Perhaps you should double-check to make sure that you've built 
everything in exactly the right order, and rebuild locate in case you've 
since upgraded some library that turns out to be subtly incompatable? 
Also, maybe the distro leaves libraries and binaries unstripped, in 
which case perhaps you should allow locate to dump core and run gdb on 
the core file, see if you can get some ideas from that.

Craig Ringer



More information about the plug mailing list