Bug 1962 - genhdlist2 doesn't reuse most of the existing hdlist
Summary: genhdlist2 doesn't reuse most of the existing hdlist
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal minor
Target Milestone: ---
Assignee: D Morgan
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 4613
  Show dependency treegraph
 
Reported: 2011-06-29 10:48 CEST by Georges Eckenschwiller
Modified: 2012-02-21 19:00 CET (History)
5 users (show)

See Also:
Source RPM: rpm perl-URPM
CVE:
Status comment:


Attachments
test case from Panu Matilainen (498 bytes, text/plain)
2011-12-06 16:17 CET, Thierry Vignaud
Details
patch from Panu Matilainen that makes headerRead works properly again for the previous test case (4.96 KB, patch)
2011-12-06 16:17 CET, Thierry Vignaud
Details | Diff
old patch of mine trying to use librpm, now working fine with previous rpm patch (3.62 KB, patch)
2011-12-06 16:18 CET, Thierry Vignaud
Details | Diff
cleaning API after previous URPM patch (1.33 KB, patch)
2011-12-06 16:24 CET, Thierry Vignaud
Details | Diff

Description Georges Eckenschwiller 2011-06-29 10:48:18 CEST
Incorrect display in genhdlist2

I created apersonal mirror of Mageia-1

1-  I do the updates with rsync.

2-  I start the creation of files with gendistrib - blind

Here is the output in genhdlist2 with mageia (version 1 and version cauldron) :

genhdlist2 running - allow-empty-media - xml-info - synthesis-filter '. CZ: gzip -9' - xml-info-filter '. lzma: lzma -5' - file-deps / var / ftp/pub/personal/1/i586/media/media_info/file-deps / var/ftp/pub/personal/1/i586/media/core_release
filtering / var/ftp/pub/personal/1/i586/media/core_release/media_info/hdlist.cz Into hdlist.cz.tmp
Adding 14,102 new rpms not available in Existing hdlist

==>  It displays the total number of files and not files added (0 file for release)

3-  When I do the same with Mandriva 2010.2, the result is correct.
Ahmad Samir 2011-06-29 11:01:56 CEST

CC: (none) => mageia, pterjan, thierry.vignaud
Source RPM: (none) => genhdlist2

Comment 1 Pascal Terjan 2011-06-30 17:27:35 CEST
I had noticed that if fails to load part the existing hdlist and will re-add everything after the failing header, but did not have time to investigate yet :(
Manuel Hiebel 2011-10-04 19:16:24 CEST

Source RPM: genhdlist2 => rpmtools

Comment 2 Thierry Vignaud 2011-10-06 10:27:26 CEST
rpm -q genhdlist2 rpmtools?
Have you tried with 6.1-1.mga2?

Keywords: (none) => NEEDINFO

Comment 3 Thierry Vignaud 2011-10-10 19:07:07 CEST
Indeed URPM::parse_hdlist__XS() has rpm::headerRead() failing to read headers after a while.
The problem is either in generating hdlists or in reading them back.
As the position it stops reading hdlist is random, it would be the later.
It also happens with rpm-4.9.

one needs to look at what makes headerRead() pukes

Keywords: NEEDINFO => (none)
CC: (none) => dmorganec
Assignee: bugsquad => thierry.vignaud

Comment 4 Thierry Vignaud 2011-10-11 15:14:14 CEST
@dexter: I think this is a regression of rpm due to the lost of ufd in rpmio.
It now expect only regular files, all the code managing regular files is now dead...
However, URPM::parse_hdlist__XS() uses a pipe as a fd...

Summary: Incorrect display in genhdlist2 => genhdlist2 doesn't reuse most of the existing hdlist
Source RPM: rpmtools => perl-URPM

Comment 5 Georges Eckenschwiller 2011-10-11 18:16:00 CEST
(In reply to comment #2)
After some absence, I see you working on problem.
Just in case, I answer all the same questions

> rpm -q genhdlist2 rpmtools?
version 6.0-1.mga1

> Have you tried with 6.1-1.mga2?
I just test it. The problem remains

Regards
Comment 6 Pascal Terjan 2011-12-02 01:45:49 CET
I tried to debug it, it seems headerRead expects timedRead(fd, (char *)&ei[2], len) to always read the full requested size but it does not (it often only gets 4992 bytes).

Just to test I changed the code to be 

    if ((a=timedRead(fd, (char *)&ei[2], len)) != len) {
        int p = 0;
        while ((a > 0) && (a < len)) {
                len -= a;
                p += a;
                a = timedRead(fd, (char *)&ei[2]+p, len);
        }
        if (a < len) {
                goto exit;
        }
    }

And it can now load all the headers.
Comment 7 Thierry Vignaud 2011-12-06 16:17:08 CET
Created attachment 1181 [details]
test case from Panu Matilainen
Comment 8 Thierry Vignaud 2011-12-06 16:17:54 CET
Created attachment 1182 [details]
patch from Panu Matilainen that makes headerRead works properly again for the previous test case
Comment 9 Thierry Vignaud 2011-12-06 16:18:31 CET
Created attachment 1183 [details]
old patch of mine trying to use librpm, now working fine with previous rpm patch
Thierry Vignaud 2011-12-06 16:18:43 CET

Status: NEW => ASSIGNED

Comment 10 Thierry Vignaud 2011-12-06 16:24:18 CET
Created attachment 1184 [details]
cleaning API after previous URPM patch
Thierry Vignaud 2011-12-06 16:32:17 CET

Keywords: (none) => PATCH

Thierry Vignaud 2011-12-21 03:28:59 CET

Source RPM: perl-URPM => rpm perl-URPM

Thierry Vignaud 2011-12-21 03:29:25 CET

Assignee: thierry.vignaud => dmorganec

Comment 11 Thierry Vignaud 2012-01-06 18:49:29 CET
@Dexter & Pascal: Ping
Comment 12 Jeff Johnson 2012-01-07 19:04:25 CET
tracked at https://bugs.launchpad.net/rpm/+bug/913203

CC: (none) => n3npq

Comment 13 Thierry Vignaud 2012-01-12 21:42:05 CET
rpm-4.9.1.2-15.mga2 & perl-URPM-3.38.5-1.4 just pushed into core/updates_testing
Please test.
Comment 14 Olivier Blin 2012-01-15 17:42:05 CET
The patch you added in perl-URPM-3.38.5-1.4 is broken, it does not pass test anymore.

Also, please do not add it as a patch in the perl-URPM package, but commit directly in the /soft SVN
Comment 15 Thierry Vignaud 2012-01-15 19:46:56 CET
It is...

And it won't be commited in soft until we agree to go with this rpm patch
Comment 16 Olivier Blin 2012-01-15 20:02:04 CET
Well, perl-URPM does not build right now because of this patch.
Should I remove it?
Comment 17 Thierry Vignaud 2012-01-15 20:05:01 CET
perl-URPM-3.36 has been uploaded...
Comment 18 Olivier Blin 2012-01-15 20:11:54 CET
Thanks for the fix.
Though, I would like to have in my in core/release, not core/updates_testing.
We should probably remove your patch in the current/ branch, and you could work from another branch.
Comment 19 Thierry Vignaud 2012-01-15 20:49:17 CET
Upload in progress.

As for removing the patch, nope. 
The patched method doesn't work anymore at least since we switched from rpm-4.6.x to rpm-4.8.x anyway...
Comment 20 Georges Eckenschwiller 2012-01-18 15:16:09 CET
Hey,

I just made an update rpm packages (testing) rpm, lib64rpm and perl-URPMI.

I made several tests to build my local mirror, after having made partial updates.
At home, the result is conclusive. Thank you all.

Packages can they be carried in core/release?
These corrections can they be made to  Mageia 1?
Comment 21 Thierry Vignaud 2012-02-08 00:28:02 CET
rpm & perl-URPM are just being pushed into core/release for mga2

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED

Pascal Terjan 2012-02-21 19:00:05 CET

Blocks: (none) => 4613


Note You need to log in before you can comment on or make changes to this bug.