emerge --sync fails with MemoryError (please see below). The same command successfully ran on this machine for almost a year until today. The machine has 2 GB of RAM and no memory or CPU-intensive processes run concurrently with the emerge. Ran eclean-dist, eclean-pkg and revdep-rebuild (just in case). Then re-ran 'emerge --sync' - with the same results. Tried to run 'emerge --sync' total 3 times today (after having removed /usr/portage/metadata/timestamp.chk). It consistently gets stuck at the same place: Number of files: 124897 Number of files transferred: 27 Total file size: 162756298 bytes Total transferred file size: 65862 bytes Literal data: 65862 bytes Matched data: 0 bytes File list size: 3026247 File list generation time: 2.051 seconds File list transfer time: 0.000 seconds Total bytes sent: 2835 Total bytes received: 3053233 sent 2835 bytes received 3053233 bytes 142142.70 bytes/sec total size is 162756298 speedup is 53.26 >>> Updating Portage cache: 73%Traceback (most recent call last): File "/usr/bin/emerge", line 5530, in ? retval = emerge_main() File "/usr/bin/emerge", line 5487, in emerge_main action_sync(settings, trees, mtimedb, myopts, myaction) File "/usr/bin/emerge", line 4205, in action_sync action_metadata(settings, portdb, myopts) File "/usr/bin/emerge", line 4300, in action_metadata eclass_cache=ec, verbose_instance=noise_maker) File "/usr/lib64/portage/pym/cache/util.py", line 41, in mirror_cache trg = trg_cache[x] File "/usr/lib64/portage/pym/cache/flat_hash.py", line 28, in __getitem__ d = self._parse_data(myf, cpv) File "/usr/lib64/portage/pym/cache/flat_hash.py", line 43, in _parse_data d = dict(map(lambda x:x.rstrip("\n").split("=", 1), data)) MemoryError
Created attachment 120107 [details] emerge --info
There must be something specific about your system that's causing it, possibly kernel related. Do you see anything abnormal in the output of dmesg? The error message indicates that it successfully synced, but the MemoryError occurred before the --metadata run completed. If you run `emerge --metadata` then it will complete what it was trying to do (if it doesn't hit another MemoryError).
Yes, it was my fault - sorry. Some of the files in the filesystem got corrupted (presumably in '/var/cache/edb/dep/usr/portage/' directory). Solution is described in http://forums.gentoo.org/viewtopic-t-561308-highlight-.html It would be nice of course if '-v' switch in 'emerge --metadata' actually did anything, maybe even outputting the name of the ebuild being processed? But I suppose it is not a part of this but but should be a separate feature request.
The length of the file must have been quite large in order to trigger the MemoryError. That type of corruption must be quite rare considering that I've never seen this error reported before. If that ever happens again, I recommend the following: rm -rf /var/cache/edb/dep && emerge --metadata
*** Bug 191319 has been marked as a duplicate of this bug. ***