Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 78979 - emerge crash with conflicting digest sizes
Summary: emerge crash with conflicting digest sizes
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-21 11:39 UTC by Andrej Kacian (RETIRED)
Modified: 2005-01-22 10:45 UTC (History)
0 users

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


Attachments
Broken Manifest file (Manifest,2.18 KB, text/plain)
2005-01-21 11:40 UTC, Andrej Kacian (RETIRED)
Details
Patched in Callers in portage.py (patch.r14.Digest.Caller,4.08 KB, patch)
2005-01-21 12:28 UTC, Alec Warner (RETIRED)
Details | Diff
Patch for handling the exception in the function itself. (patch.r14.Digest.Function,818 bytes, patch)
2005-01-21 12:31 UTC, Alec Warner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrej Kacian (RETIRED) gentoo-dev 2005-01-21 11:39:22 UTC
This is my output:

>>> emerge (4 of 6) mail-client/sylpheed-claws-1.0.0 to /
Traceback (most recent call last):
  File "/usr/bin/emerge", line 3045, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1838, in merge
    retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug)
  File "/usr/lib/portage/pym/portage.py", line 2608, in doebuild
    if not digestcheck(checkme, mysettings, ("strict" in features)):
  File "/usr/lib/portage/pym/portage.py", line 2196, in digestcheck
    mymdigests=digestParseFile(manifestfn)
  File "/usr/lib/portage/pym/portage.py", line 2124, in digestParseFile
    raise portage_exception.DigestException, "Conflicting sizes in digest: %(filename)s" % {"filename":myfilename}
portage_exception.DigestException: 'Conflicting sizes in digest: /usr/portage/mail-client/sylpheed-claws/Manifest'

On further investigating, I've found out that cvs update b0rked my Manifest file (attached). Maybe emerge should do a more strict data correctness checking or something.
Comment 1 Andrej Kacian (RETIRED) gentoo-dev 2005-01-21 11:40:03 UTC
Created attachment 49124 [details]
Broken Manifest file
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-01-21 12:10:29 UTC
I'm not sure how you guys like catching exceptions.  If you leave the try: except: block in the function it contains the handler close to the code that raised and you get action right away.  If you leave the try: except: blocks to the callers whomever uses the function has to know to put those blocks there, but gets the advantage of possibly recovering the error instead of doing what I just did ( printing an error message ).  So I'll submit 2 patches, one handling it in the functoin, and one handling it in the 3 calls I found in portage.py.
Comment 3 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-01-21 12:28:52 UTC
Created attachment 49131 [details, diff]
Patched in Callers in portage.py

This is probably the worse one, there could be other files that call this
function, I haven't looked at them all yet.  Exception handled in the Called
and not the function itself.
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-01-21 12:31:21 UTC
Created attachment 49132 [details, diff]
Patch for handling the exception in the function itself.  

Handles the exception in the functoin itself.  Kind of stupid because it's
thrown in the function as well, but you don't have the hassle of changing every
other call in portage.
Comment 5 Jason Stubbs (RETIRED) gentoo-dev 2005-01-21 17:15:55 UTC
The final line of the exception is fairly straightforward to understand and that's about the best we can offer at the moment. And no, we can't do more strict data-correctness testing. We *were* doing that and now can't introduce SHA1 sums into the tree because they don't fit into previous portage versions' idea of correct. At the moment, any line beginning with "MD5" is checked for correctness.
Comment 6 Andrej Kacian (RETIRED) gentoo-dev 2005-01-21 17:19:19 UTC
Actually, the line doesn't say what's wrong with the manifest - it was b0rked by cvs update, not containing wrong size for some file. Atleast emerge should ignore lines not beginning with MD5 - it shouldn't be hard to not ignore lines starting with SHA1 later.
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2005-01-21 17:33:49 UTC
<<<<<<< Manifest
MD5 7b8a169ad5b6a1b0574273eabcd1e3b5 ChangeLog 18177
<snip>
MD5 731014f8588d480e362722ce7892c719 ChangeLog 18324
<snip>

Would you prefer that it said 'Duplicate entry with conflicting sizes in digest' instead?
Comment 8 Andrej Kacian (RETIRED) gentoo-dev 2005-01-21 17:40:44 UTC
Actually, I'd prefer it to say something along the lines of "Metadata file corrupted", but what with GPG signature lines being in there, I guess that would be quite hard to detect. What you suggested would suffice, unless it slows manifest parsing too much.
Comment 9 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-01-22 10:45:18 UTC
The only problem with the current code is that it does not give a solution for repairing the Manifest file.  Not everyone knows what is going on under the hood here.