[plug] updatedb & locate

Craig Dyke grail at westnet.com.au
Wed Jun 25 21:20:11 WST 2003


On Tue, 2003-06-24 at 22:54, Craig Ringer wrote:
> >
> >
> >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)?

Output:

root at Coven:~# ldd `which locate`
        libintl.so.2 => /usr/lib/libintl.so.2 (0x40022000)
        libc.so.6 => /lib/libc.so.6 (0x4002c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

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

Output:


execve("/usr/bin/locate", ["locate"], [/* 16 vars */]) = 0
brk(0)                                  = 0x804ac40
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=50300, ...}) = 0
old_mmap(NULL, 50300, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40015000
close(3)                                = 0
open("/usr/lib/libintl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\32\0"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0644, st_size=39279, ...}) = 0
old_mmap(NULL, 34076, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x40022000
mprotect(0x4002a000, 1308, PROT_NONE)   = 0
old_mmap(0x4002a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x7000) = 0x4002a000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200X\1"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1241592, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x4002b000
old_mmap(NULL, 1230852, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x4002c000
mprotect(0x40152000, 26628, PROT_NONE)  = 0
old_mmap(0x40152000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x126000) = 0x40152000
old_mmap(0x40156000, 10244, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40156000
close(3)                                = 0
munmap(0x40015000, 50300)               = 0
write(2, "Usage: locate [-d path] [--datab"..., 74Usage: locate [-d
path] [--database=path] [--version] [--help] pattern...
) = 74
exit_group(1)                           = ?

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

Output:

Distro = SourceMage (latest)
locate version = GNU locate version 4.1

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

Yes have deleted locatedb and run updatedb with same results.
Not sure about old or new locate or slocate.

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

Have rebuilt locate also to no avail.
> 
> Craig Ringer
> 

Still stuck :(

Craig



More information about the plug mailing list