Project:Toolchain/Corrupt VDB ELF files

Background
The key facts are as follows:

VDB

 * The VDB is a set of files with metadata about installed packages, typically under . Information about each package is recorded there at emerge-time about the contents of the package, its dependencies, the build environment, etc.

Problem point

 * If Portage was at some point unable to run (from ) during a package install, it may have generated incomplete ELF metadata inside the VDB, such as missing ,  ,  , or   files.
 * These are the files that Portage refers to when determining out what old libraries need to be preserved during an upgrade because of existing consumers of the old versions.


 * Only packages installed while was unavailable are broken.
 * (So, one could grep for packages upgraded between major versions and  in )


 * Typically an affected system will have some packages that included shared libraries (.so files listed in its  file), but have no   and/or   files.


 * This corruption may not reveal itself until a change occurs in the corrupted packages, e.g. new major version with ABI incompatibility and a new SONAME.

Impact

 * If a change occurs in a package with corrupted metadata, Portage will fail to detect that the older version of the library is required due to the corrupt database.
 * It may then remove older versions of the library depended on by other packages (until they are e.g. rebuilt) which could leave them in a broken state.


 * Most of the time, if an old library is removed when it was still needed by some package, this will have only a fairly local effect: said package can't run until it is rebuilt against the newer library.
 * However, the worst-case-scenario is when a library critical to Portage has been removed, e.g. a upgrade.