[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#431143: libc6: ldconfig mmaps every library file whether it needs and update or not



Package: libc6
Version: 2.5-11
Severity: normal

Since #374945 has been closed and indeed archived, the patch fixing it
has been backed out.  I can't reopen that bug, but please consult
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374945.html for the
background information.

Essentially, ldconfig is run after every lib*.deb package is updated
in a dpkg run.  This can be hundreds of times in a move between debian
releases.  After each time ldconfig is run, on machines with less than
about 256MB, everything ldconfig dealt with has long been purged out
of filesystem cache by the time the next package comes along to run
ldconfig (on my 256MB machine, dpkg can be updating two library
packages successively, and nothing remains in cache by the time the
second library has installed its files and runs its postinst scripts).
So when everyone claims that it's not so bad that ldconfig is run
multiple times, because the second time is always much quicker, they
are operating under the hidden false assumption that everyone is
blessed with a machine with more than 256MB.  They didn't even become
universally common until about a year ago in these quarters and I
still see plenty of new machines with only 256MB on dell's website.

Now the cause of the problem is that for every ldconfig call that
ought to just update the symlinks of the one package in question, and
perhaps update the ld.so.cache file (although on a quick glance
through an strace call to a typical program, that appears entirely
unnecessary), an open(), fstat64(), and crucially, a mmap() and hence
presumably, slurping in some of that file's contents, is done on every
file in every lib directory.  All of that, for every file, has to fit
in cache, if the second invocation to ldconfig a few seconds later is
going to take any less time than the first.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.20-1-686 (SMP w/1 CPU core)
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages libc6 depends on:
ii  libgcc1                 1:4.2-20070627-1 GCC support library

libc6 recommends no packages.

-- no debconf information



Reply to: