I have Portage r10416. I upgraded sys-devel/gcc-4.2.3 to sys-devel/gcc-4.2.4: !! existing preserved libs: >>> package: sys-devel/gcc-4.2.4 * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libgcc_s.so * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6 * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libgcc_s.so.1 Use emerge @preserved-rebuild to rebuild packages using these libraries # emerge -ptv @preserved-rebuild Traceback (most recent call last): File "/usr/bin/emerge", line 18, in <module> retval = _emerge.emerge_main() File "/usr/lib/portage/pym/_emerge/__init__.py", line 8866, in emerge_main if not setconfig.getSetAtoms(s): File "/usr/lib/portage/pym/portage/sets/__init__.py", line 103, in getSetAtoms myatoms = myset.getAtoms() File "/usr/lib/portage/pym/portage/sets/base.py", line 53, in getAtoms self._load() File "/usr/lib/portage/pym/portage/sets/base.py", line 48, in _load self.load() File "/usr/lib/portage/pym/portage/sets/libs.py", line 46, in load consumers.update(self.dbapi.linkmap.findConsumers(lib)) File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 220, in findConsumers raise KeyError("%s not in object list" % obj) KeyError: '/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6.0.9 not in object list' #
Created attachment 154277 [details] /var/cache/edb/library_consumers
Created attachment 154279 [details] /var/lib/portage/preserved_libs_registry
Hmm, I wasn't able to reproduce the problem (using r10466), probably because the libs were (correctly) not preserved here. As >=pre6 doesn't generate/use the library_consumers file anymore it's unfortunately useless for debugging. There are several questions here: a) why are those libs preserved? (likely the root problem) b) why is libstdc++.so.6.0.9 not preserved? c) why is the searched library not registered in the internal dict, resulting in the KeyError? d) why does it only happen on some systems? (you aren't the only one reporting it, but if the majority of users would be affected I'd expect more reports even though it's only affecting >=pre6) c) is likely a direct result of b), but still worth to investigate. Some informations that might help to answer these questions: 1) emerge -Opv ~sys-devel/gcc-4.2.4 ~sys-devel/gcc-4.2.3 (only the relevant lines, ignore the error message) 2) ls -l /usr/lib/gcc/*/*/libstdc++.so* /usr/lib/libstdc++.so* 3) equery files sys-devel/gcc | fgrep libstdc++ 4) python -c 'from portage.util import getlibpaths; print getlibpaths()' 5) python -c 'import portage, pickle; l=portage.db["/"]["vartree"].dbapi.linkmap; l.rebuild(); pickle.dump(l, file("linkmap", "w"))' # and attach the resulting linkmap file (you probably have to compress it)
Some days ago I manually deleted preserved libraries. Today I downgraded sys-devel/gcc-4.2.4 to sys-devel/gcc-4.2.3 and I reproduced this problem again. I have Portage r10520. !!! existing preserved libs: >>> package: sys-devel/gcc-4.2.3 * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libgcc_s.so * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so.6 * - /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libgcc_s.so.1 Use emerge @preserved-rebuild to rebuild packages using these libraries # emerge -ptv @preserved-rebuild Traceback (most recent call last): File "/usr/bin/emerge", line 18, in <module> retval = _emerge.emerge_main() File "/usr/lib/portage/pym/_emerge/__init__.py", line 9073, in emerge_main if not setconfig.getSetAtoms(s): File "/usr/lib/portage/pym/portage/sets/__init__.py", line 103, in getSetAtoms myatoms = myset.getAtoms() File "/usr/lib/portage/pym/portage/sets/base.py", line 53, in getAtoms self._load() File "/usr/lib/portage/pym/portage/sets/base.py", line 48, in _load self.load() File "/usr/lib/portage/pym/portage/sets/libs.py", line 46, in load consumers.update(self.dbapi.linkmap.findConsumers(lib)) File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 220, in findConsumers raise KeyError("%s not in object list" % obj) KeyError: '/usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so.6.0.9 not in object list' # emerge -Opv ~sys-devel/gcc-4.2.4 ~sys-devel/gcc-4.2.3 These are the packages that would be merged, in order: [ebuild U ] sys-devel/gcc-4.2.4 [4.2.3] USE="doc mudflap nls openmp (-altivec) -bootstrap -build -fortran -gcj -gtk (-hardened) -ip28 -ip32r10k -libffi (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla" 0 kB [ebuild R ] sys-devel/gcc-4.2.3 USE="doc mudflap nls openmp (-altivec) -bootstrap -build -fortran -gcj -gtk (-hardened) -ip28 -ip32r10k -libffi (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla" 0 kB ... # LC_ALL=C ls -l /usr/lib/gcc/*/*/libstdc++.so* /usr/lib/libstdc++.so* ls: cannot access /usr/lib/libstdc++.so*: No such file or directory lrwxrwxrwx 1 0 0 18 2008-05-31-19-26-05 /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so -> libstdc++.so.6.0.9* lrwxrwxrwx 1 0 0 18 2008-05-31-19-26-09 /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6 -> libstdc++.so.6.0.9* -rwxr-xr-x 1 0 0 912K 2008-02-17-21-20-59 /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6.0.9* lrwxrwxrwx 1 0 0 18 2008-05-31-19-26-05 /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so -> libstdc++.so.6.0.9* lrwxrwxrwx 1 0 0 18 2008-05-31-19-26-05 /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so.6 -> libstdc++.so.6.0.9* -rwxr-xr-x 1 0 0 908K 2008-05-25-19-10-33 /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so.6.0.9* lrwxrwxrwx 1 0 0 19 2008-03-21-17-12-43 /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++.so -> libstdc++.so.6.0.10* lrwxrwxrwx 1 0 0 19 2008-03-21-17-12-43 /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++.so.6 -> libstdc++.so.6.0.10* -rwxr-xr-x 1 0 0 921K 2008-03-21-17-10-53 /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++.so.6.0.10* # equery files sys-devel/gcc | fgrep libstdc++ /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.a /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6 /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6.0.9 /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++_pic.a /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so.6 /usr/lib/gcc/i686-pc-linux-gnu/4.2.4/libstdc++.so.6.0.9 /usr/share/gcc-data/i686-pc-linux-gnu/4.2.3/locale/de/LC_MESSAGES/libstdc++.mo /usr/share/gcc-data/i686-pc-linux-gnu/4.2.3/locale/fr/LC_MESSAGES/libstdc++.mo /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++.a /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++.so.6 /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++.so.6.0.10 /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/libstdc++_pic.a /usr/share/gcc-data/i686-pc-linux-gnu/4.3.0/locale/de/LC_MESSAGES/libstdc++.mo /usr/share/gcc-data/i686-pc-linux-gnu/4.3.0/locale/fr/LC_MESSAGES/libstdc++.mo # python -c 'from portage.util import getlibpaths; print getlibpaths()' ['/usr/local/lib', '/usr/lib/opengl/nvidia/lib', '/usr/i686-pc-linux-gnu/lib', '/usr/lib/gcc/i686-pc-linux-gnu/4.2.3', '/usr/lib/gcc/i686-pc-linux-gnu/4.3.0', '/usr/lib/nspr', '/usr/lib/nss', '/usr/lib/qca1', '/usr/lib/qca2', '/usr/lib/qt4', '/usr/kde/3.5/lib', '/usr/qt/3/lib', '/usr/games/lib', '/usr/lib/fltk-1.1', '/usr/lib/libstdc++-v3', '/usr/lib', '/lib'] #
Created attachment 154981 [details] linkmap
Not sure if that's the reason, but your linkmap seems to be screwed up as for some records the fields aren't in the right order (e.g. runpath and needed attributes are swapped). Might have happened if you merged packages while the code was new and the format wasn't finalized (this would not affect people that only used releases though). Please remove all NEEDED.ELF.2 files from /var/db/pkg and regenerate them with the code from the pre7 ebuild.
Actually, do not use the code in the pre7 ebuild, the scanelf call contains another bug that corrupts certain library names (like libstdc++).
Just committed a pre7-r1 ebuild that contains several fixes in the conversion code, please use that to rebuild all NEEDED.ELF.2 files.
Created attachment 155873 [details] linkmap
I regenerated all NEEDED.ELF.2 files. I reproduced this bug with app-text/poppler. I upgraded app-text/poppler-0.6.3 to app-text/poppler-0.8.3. I have Portage r10590. # emerge -ptv @preserved-rebuild Traceback (most recent call last): File "/usr/bin/emerge", line 18, in <module> retval = _emerge.emerge_main() File "/usr/lib/portage/pym/_emerge/__init__.py", line 9120, in emerge_main if not setconfig.getSetAtoms(s): File "/usr/lib/portage/pym/portage/sets/__init__.py", line 103, in getSetAtoms myatoms = myset.getAtoms() File "/usr/lib/portage/pym/portage/sets/base.py", line 53, in getAtoms self._load() File "/usr/lib/portage/pym/portage/sets/base.py", line 48, in _load self.load() File "/usr/lib/portage/pym/portage/sets/libs.py", line 46, in load consumers.update(self.dbapi.linkmap.findConsumers(lib)) File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 220, in findConsumers raise KeyError("%s not in object list" % obj) KeyError: '/usr/lib/libpoppler.so.2.0.0 not in object list' # portageq list_preserved_libs / app-text/poppler-0.8.3 /usr/lib/libpoppler.so.2 # emerge -Opv ~app-text/poppler-0.6.3 ~app-text/poppler-0.8.3 These are the packages that would be merged, in order: [ebuild UD] app-text/poppler-0.6.3 [0.8.3] USE="jpeg zlib -cjk" 0 kB [ebuild R ] app-text/poppler-0.8.3 USE="jpeg zlib -cjk" 0 kB Total: 2 packages (1 downgrade, 1 reinstall), Size of downloads: 0 kB ... # ls -l /usr/lib/libpoppler.so* lrwxrwxrwx 1 0 0 19 2008-06-07-22-56-53 /usr/lib/libpoppler.so -> libpoppler.so.3.0.0* lrwxrwxrwx 1 0 0 19 2008-06-07-22-55-55 /usr/lib/libpoppler.so.2 -> libpoppler.so.2.0.0* -rwxr-xr-x 1 0 0 1,6M 2008-01-24-20-01-22 /usr/lib/libpoppler.so.2.0.0* lrwxrwxrwx 1 0 0 19 2008-06-07-22-56-53 /usr/lib/libpoppler.so.3 -> libpoppler.so.3.0.0* -rwxr-xr-x 1 0 0 1,7M 2008-06-07-22-55-40 /usr/lib/libpoppler.so.3.0.0* # equery files poppler | fgrep libpoppler /usr/lib/libpoppler.a /usr/lib/libpoppler.la /usr/lib/libpoppler.so /usr/lib/libpoppler.so.2 /usr/lib/libpoppler.so.2.0.0 /usr/lib/libpoppler.so.3 /usr/lib/libpoppler.so.3.0.0 # python -c 'from portage.util import getlibpaths; print getlibpaths()' ['/usr/local/lib', '/usr/lib/opengl/nvidia/lib', '/usr/i686-pc-linux-gnu/lib', '/usr/lib/gcc/i686-pc-linux-gnu/4.2.4', '/usr/lib/gcc/i686-pc-linux-gnu/4.3.0', '/usr/lib/nspr', '/usr/lib/nss', '/usr/lib/qca1', '/usr/lib/qca2', '/usr/lib/qt4', '/usr/kde/3.5/lib', '/usr/qt/3/lib', '/usr/games/lib', '/usr/lib/fltk-1.1', '/usr/lib/libstdc++-v3', '/usr/lib', '/lib'] #
Created attachment 155935 [details, diff] Patch to correct the scanelf call for preserved libs Please test with this patch and report back if it fixes the problem for you (esp. the gcc issue if you can reproduce it/haven't manually fixed it)
Created attachment 155943 [details, diff] Patch to correct scanelf call and symlink preservation issue This patch fixes another bug related to registration of preserved libs
Just some feedback: I installed 2.2_pre7-r1 on an old system (mainly so I don't have to resolve the many blockers of the last half year manually) and I had both bug #220671 and after solving it with the patch provided there, this keyerror (which *is* solved by the patch provided here), both while emerging gcrypt.
Needless preservation of sys-devel/gcc libraries moved to Bug #225429.