Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 539746 - Emerge (portage-2.2.16) multiple packages destroy content /var/lib/portage/world
Summary: Emerge (portage-2.2.16) multiple packages destroy content /var/lib/portage/world
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: AMD64 Linux
: Normal critical with 1 vote (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, PMASKED
Depends on:
Blocks: 484436
  Show dependency tree
 
Reported: 2015-02-11 09:45 UTC by Jiri Netolicky
Modified: 2015-02-12 06:04 UTC (History)
14 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Netolicky 2015-02-11 09:45:14 UTC
When I try to emerge multiple packges in one command for example:

emerge maven-bin valgrind argyllcms nodejs

The content of /var/lib/portage/world is destroyed and the content is the name
of last emerged package.

Reproducible: Always

Steps to Reproduce:
1. backup /var/lib/portage/world
2. emerge any more then one packages
3. check content /var/lib/portage/world
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-02-11 09:49:41 UTC
I'll apply immediate precautionary mask.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-02-11 09:51:10 UTC
+  11 Feb 2015; Michał Górny <mgorny@gentoo.org> package.mask:
+  Mask new portage versions because of bug #539746.

Applied.
Comment 3 octoploid 2015-02-11 10:55:12 UTC
Got hit by this bug yesterday.
Afterwards --depclean tried to remove half of my system....
Comment 4 Tom Otto 2015-02-11 10:59:52 UTC
Can confirm, after two randomly chosen packages, world contains only the last entry:

# emerge radlib quazip -av
(...)
$ cat /var/lib/portage/world
dev-libs/quazip
Comment 5 Sven B. 2015-02-11 11:23:05 UTC
Can confirm as well. Emerged two randomly choosen packages and got the same effect.
Comment 6 Austin S. Hemmelgarn 2015-02-11 14:40:36 UTC
Can also confirrm, although based on personal experience, it only appears to happen _after_ the last package is merged.
Comment 7 Brian Dolbec (RETIRED) gentoo-dev 2015-02-11 14:54:12 UTC
I just did some testing and it seems it is only triggered for new pkgs added to the list.

emerging 2 pkgs already in the list, does not re-produce.

I do fear that this error will apply to several last releases of portage.  I think my world file has been messed with for quite some time and have been avoiding a depclean because of it.

I'll try to find out why.  I do not recall any code changes in the world file handling for many releases.  So, why is this only being discovered now.
Comment 8 Andrew Savchenko gentoo-dev 2015-02-11 14:59:29 UTC
(In reply to Brian Dolbec from comment #7)
> I do fear that this error will apply to several last releases of portage.  I
> think my world file has been messed with for quite some time and have been
> avoiding a depclean because of it.

I'm not sure. Just few days ago I setup a new system with portage-2.2.15, I surely added several new packages using emerge -av name1 name2 ... to the system and /var/lib/portage/world file is OK here. So this is clear 2.2.16 regression.
Comment 9 Johannes Hirte 2015-02-11 15:58:43 UTC
(In reply to Brian Dolbec from comment #7)
> I do fear that this error will apply to several last releases of portage.  I
> think my world file has been messed with for quite some time and have been
> avoiding a depclean because of it.

Downgrade to 2.2.15 fixed the problem for me.
Comment 10 Brian Dolbec (RETIRED) gentoo-dev 2015-02-11 16:20:49 UTC
OK, found and confirmed it to be commit a4784ffb9406e69811aaf21818459aff00fadb6b

I've reverted it in git for now.  Ill push out 2.2.17 when we have a proper fix to replace that commit.
Comment 11 Zac Medico gentoo-dev 2015-02-11 18:57:24 UTC
(In reply to Brian Dolbec from comment #10)
> OK, found and confirmed it to be commit
> a4784ffb9406e69811aaf21818459aff00fadb6b
> 
> I've reverted it in git for now.  Ill push out 2.2.17 when we have a proper
> fix to replace that commit.

I have a working fix in the following branch:

https://github.com/zmedico/portage/tree/bug_539746

I've posted it for review here:

http://thread.gmane.org/gmane.linux.gentoo.portage.devel/5216
Comment 12 Zac Medico gentoo-dev 2015-02-11 19:25:17 UTC
This is in the master branch now:

https://github.com/gentoo/portage/commit/c3586c5e15c8373d08f9192713a2b03d4542faaf
Comment 13 Ulenrich 2015-02-11 23:09:47 UTC
having patched _sets/files.py 
<-->def write(self):
<--><-->self._pkgset._atoms = self._atoms.copy()
<--><-->self._pkgset.write()
<--><-->self._setset._nonatoms = self._nonatoms.copy()
<--><-->self._setset.write()

<-->def load(self):
<--><-->self._setAtoms(chain(self._pkgset, self._setset))
---
gives a portage-2.2.16 flawlessly working
Comment 14 Joe Kappus 2015-02-12 01:49:49 UTC
and yet -9999 is still hardmasked for this bug? 

I hit this back in beginning of January, never pieced what happened together.  World file can be pretty easily regenerated with a script though.  I'm including details below because even if off-topic it might save a lot of frustration.

Information here for anyone unfortunate enough to hit this bug:  http://forums.gentoo.org/viewtopic-t-869667.html

Install eix and uncomment the eix lines in the script... comment out the equery lines and it should work well.
Comment 15 Brian Dolbec (RETIRED) gentoo-dev 2015-02-12 06:03:47 UTC
portage-2.2.16
Portage-2.2.17 has been released with all 2.2.16 regressions fixed.
Comment 16 Brian Dolbec (RETIRED) gentoo-dev 2015-02-12 06:04:23 UTC
Oops, portage-2.2.16 has been removed from the tree.