Bug 57897

Summary: slocate no longer works with glibc-2.2.4
Product: [Retired] Red Hat Raw Hide Reporter: Ville Herva <v>
Component: slocateAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-24 22:23:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Ville Herva 2001-12-31 06:45:34 UTC
Description of Problem:
After I upgraded to glibc-2.2.4, slocate seized to 
work

Version-Release number of selected component (if applicable):
rpm -q 
slocate
slocate-2.6-1(also happened with slocate-2.4-1)
rpm -q glibc  
glibc-2.2.4-
20 (also happened with glibc-2.2.4-18)

I _think_ it worked with slocate-2.4-1 + glibc-
2.2.3-1.


How Reproducible:
Always for me

Steps to 
Reproduce:
1. Run updatedb

Actual Results:
It does 
nothing

Expected Results:
Generate non-empty 
slocate.db

Additional Information:
Here's the strace:

strace 
updatedb -u               
execve("/usr/bin/updatedb", ["updatedb", "-u"], [/* 44 vars */]) = 
0
uname({sys="Linux", node="babbage", ...}) = 0
brk(0)                                  = 
0x804fd68
fcntl64(0, F_GETFD)                     = 0
fcntl64(1, F_GETFD)                     = 0
fcntl64(2, 
F_GETFD)                     = 0
access("/etc/suid-debug", F_OK)         = -1 ENOENT (No such file or 
directory)
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40017000
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=75619, ...}) = 0
old_mmap(NULL, 75619, 
PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3)                                = 
0
open("/lib/i686/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\0\310\1"..., 1024) = 
1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=5815096, ...}) = 
0
old_mmap(NULL, 1298400, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
0x4002b000
mprotect(0x4015e000, 40928, PROT_NONE)  = 
0
old_mmap(0x4015e000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED, 3, 0x132000) = 
0x4015e000
old_mmap(0x40164000, 16352, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40164000
close(3)                                
= 0
munmap(0x40018000, 75619)               = 0
open("/etc/updatedb.conf", O_RDONLY)    
= 3
brk(0)                                  = 0x804fd68
brk(0x8050d80)                          = 0x8050d80
brk(0x8051000)                          = 
0x8051000
read(3, "PRUNEFS=\"devpts NFS nfs afs proc"..., 4096) = 
174
close(3)                                = 0
open("/etc/mtab", O_RDONLY)             = 3
brk(0x8053000)                          = 
0x8053000
read(3, "/dev/hdf3 / auto rw 0 0\nnone /pr"..., 4096) = 829
close(3)                                = 
0
lstat64("/var/lib/slocate/", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 
0
getcwd("/", 4095)                       = 2
getuid32()                              = 0
getgid32()                              = 
0
lstat64("/var/lib/slocate/", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 
0
socket(PF_UNIX, SOCK_STREAM, 0)         = 3
connect(3, {sin_family=AF_UNIX, 
path="                                                                                       /var/run/.nscd_socket"}, 110) =-1 ENOENT (No such file or directory)
close(3)                                
= 0
open("/etc/nsswitch.conf", O_RDONLY)    = 3
fstat64(3, 
{st_mode=S_IFREG|0644, st_size=1744, ...}) = 0
mmap2(NULL, 4096, 
PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40018000
read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 
1744
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40018000, 4096)                = 
0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, 
{st_mode=S_IFREG|0644, st_size=75619, ...}) = 0
old_mmap(NULL, 75619, 
PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3)                                = 
0
open("/lib/libnss_files.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\200 \0"..., 1024) = 
1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=262272, ...}) = 
0
old_mmap(NULL, 42600, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
0x40168000
mprotect(0x40172000, 1640, PROT_NONE)   = 
0
old_mmap(0x40172000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED, 3, 0x9000) = 0x40172000
close(3)                                = 
0
munmap(0x40018000, 75619)               = 0
open("/etc/group", O_RDONLY)            = 
3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 
0
fstat64(3, {st_mode=S_IFREG|0644, st_size=792, ...}) = 0
mmap2(NULL, 
4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40018000
read(3, "root::0:root\nbin::1:root,bin,dae"..., 4096) = 792
close(3)                                
= 0
munmap(0x40018000, 4096)                = 0
open("/var/lib/slocate/slocate.db.tmp", 
O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fstat64(3, 
{st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 4096, 
PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40018000
brk(0x8055000)                          = 0x8055000
lstat64("/", 
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open(".", O_RDONLY)                     = 
4
fchdir(4)                               = 0
fchdir(4)                               = 0
close(4)                                = 0
write(3, "1", 1)                        = 1
close(3)                                = 
0
munmap(0x40018000, 4096)                = 0
chdir("/")                              = 
0
rename("/var/lib/slocate/slocate.db.tmp", "/var/lib/slocate/slocate.db") = 
0
chmod("/var/lib/slocate/slocate.db", 0640) = 
0
chown32("/var/lib/slocate/slocate.db", 0, 21) = 0
_exit(0)                                = ?

I tried 
forcing it to use, glibc-2.2.3 - it seemed to try to do something, but then segfaulted (no 
surprise).

"updatedb -U /tmp" etc don't work either. I'm puzzled...

Comment 1 Ville Herva 2001-12-31 07:01:59 UTC
I just rechecked with my backup - using these:

rpm -q glibc
glibc-2.2.3-19.1
rpm -q 
slocate
slocate-2.4-1

it works.



Comment 2 Ville Herva 2001-12-31 07:07:14 UTC
Ummh, it ain't that. Witness:

2001-12-16:
>chroot /backup-versioned/2001-12-
16T052001 /bin/zsh 
>mv /var/lib/slocate/slocate.db 
/var/lib/slocate/slocate.db.back
>/etc/cron.daily/slocate.cron
<exits 
imediately>
>L /var/lib/slocate/slocate.db*
-rw-r-----    1 root     slocate         1 Dec 31 08:54 
/var/lib/slocate/slocate.db
-rw-r-----    1 root     slocate         1 Dec 16 04:50 
/var/lib/slocate/slocate.db.back
>mv /var/lib/slocate/slocate.db.back 
/var/lib/slocate/slocate.db

>rpm -q glibc slocate 
glibc-2.2.4-18
slocate-2.4-
1
>rpm -V glibc slocate
S.5....T   /etc/cron.daily/slocate.cron
>md5sum =slocate 
/etc/updatedb.conf /etc/cron.daily/slocate.cron /lib/i686/libc.so.6 /lib/libnss_files.so.2 

efd7af5b68421e8379f2830b9b8d1abe  
/usr/bin/slocate
2132d4bc1fa63e44cd92fb0ae40cdc8d  
/etc/updatedb.conf
10d1ab4b969754774f28352d25a7ef19  
/etc/cron.daily/slocate.cron
83119f8da8abfc2a05c036bdfb8d2eeb  
/lib/i686/libc.so.6
4a7f9e44cfcdf8572523e613bcb07c0e  
/lib/libnss_files.so.2

2001-12-14:
>chroot /backup-versioned/2001-12-14T052001 
/bin/zsh 
>mv /var/lib/slocate/slocate.db 
/var/lib/slocate/slocate.db.back
>/etc/cron.daily/slocate.cron
<ctrl-c>
>ls -l 
/var/lib/slocate/slocate.db*
-rw-r-----    1 root     slocate   4845689 Dec 14 04:57 
/var/lib/slocate/slocate.db.back
-rw-r-----    1 root     slocate    249856 Dec 31 08:58 
/var/lib/slocate/slocate.db.tmp

root@babbage:/>rpm -q glibc slocate 
glibc-2.2.4-
18
slocate-2.4-1
root@babbage:/>rpm -V glibc slocate
S.5....T   
/etc/cron.daily/slocate.cron
root@babbage:/>md5sum =slocate /etc/updatedb.conf 
/etc/cron.daily/slocate.cron /lib/i686/libc.so.6 
/lib/libnss_files.so.2
efd7af5b68421e8379f2830b9b8d1abe  
/usr/bin/slocate
2132d4bc1fa63e44cd92fb0ae40cdc8d  
/etc/updatedb.conf
10d1ab4b969754774f28352d25a7ef19  
/etc/cron.daily/slocate.cron
83119f8da8abfc2a05c036bdfb8d2eeb  
/lib/i686/libc.so.6
4a7f9e44cfcdf8572523e613bcb07c0e  
/lib/libnss_files.so.2


So something extraordinary broke between 14th and 16th, 
but what on Earth could it be? I may have upgraded something, but I don't recall, 
what.


>cat /etc/updatedb.conf 
PRUNEFS="devpts NFS nfs afs proc smbfs 
autofs auto iso9660"
PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /net" 
export 
PRUNEFS
export PRUNEPATHS
>cat 
/etc/cron.daily/slocate.cron
#!/bin/sh
/usr/bin/updatedb -f 
"nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp,/afs,/net,/backup-
versioned,/home/sftp/jail"


Comment 3 Ville Herva 2001-12-31 08:31:31 UTC
Ok, I found out the crucial difference.

I had changed rootfs type from ext3 to auto in 
/etc/fstab.(updatedb read mtab, not fstab, but the auto setting propagates to there frm 
fstab.)

If I change 

/dev/hdf3 / auto rw 0 0

to

/dev/hdf3 / ext3 rw 0 
0

in mtab, and rerun updatedb, it works.

And look and behold, "auto" is excluded 
by default in /etc/updatedb.conf

I'm not sure what is the default in fstab for redhat-7.2 or 
rawhide, "auto" or "ext3"? Propably "ext3"?


Comment 4 Bill Nottingham 2003-01-24 22:23:45 UTC
ext3.  We haven't used auto for local filesystems.

Comment 5 Ville Herva 2003-01-25 08:12:39 UTC
So you have a (good) reason to exclude fs type auto in updatedb.conf?

Perhaps you could add this to FAQ or something? I think it was pretty nasty problem to solve from end user point of view.

Thanks.