This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 982348 - rpm failed to install package with large number of files
rpm failed to install package with large number of files
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
18
All Linux
unspecified Severity low
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-08 14:41 EDT by Damian Wrobel
Modified: 2014-02-06 01:42 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-05 18:12:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Damian Wrobel 2013-07-08 14:41:35 EDT
Description of problem:
rpm reports that the installation process of package which contains large number of files (~68k files) failed without giving any meaningful reason.

Version-Release number of selected component (if applicable):
rpm-4.10.3.1-1.fc18.i686

How reproducible:
100%

Steps to Reproduce:
1. create an rpm package which contains a large number of files (in my case it's about 68k small files which is a database for another program)
2. rpm -i <package_name>

Actual results:
error: installation failed

Expected results:
Package should be installed without error.

Additional info:
Unfortunately neither -vv argument option passed to the rpm nor the strace didn't give me any clue.

Debugging showed that the problem is in the lib/header.c:547 line:
/* Sanity checks on header intro. */
if (hdrchkTags(il) || hdrchkData(dl))
    goto errxit;

More precisely the hdrchkData(dl) marco returns true as the dl > HEADER_DATA_MAX
(it's equal to 0x11df6b8)

Definition is in the lib/header_internal.h:
/**
 * Sanity check on data size and/or offset and/or count.
 * This check imposes a limit of 16 MB, more than enough.
 */
#define HEADER_DATA_MAX 0x00ffffff
#define hdrchkData(_nbytes) ((_nbytes) & (~HEADER_DATA_MAX))

Backtrace:
(gdb) bt
#0  headerExport (h=0x8087868, bsize=0xbfffefe8) at header.c:547
#1  0x4003c7d9 in rpmdbAdd (db=0x807d188, h=0x8087868) at rpmdb.c:2654
#2  0x40054000 in rpmpsmStage (psm=0x807ed90, stage=PSM_RPMDB_ADD) at psm.c:982
#3  0x400533f5 in rpmpsmNext (psm=0x807ed90, nstage=PSM_RPMDB_ADD) at psm.c:703
#4  0x40053c94 in rpmpsmStage (psm=0x807ed90, stage=PSM_POST) at psm.c:891
#5  0x400533f5 in rpmpsmNext (psm=0x807ed90, nstage=PSM_POST) at psm.c:703
#6  0x40054317 in rpmpsmRun (ts=0x807cc70, te=0x807ede0, goal=PKG_INSTALL) at psm.c:1042
#7  0x4006848a in rpmteProcess (te=0x807ede0, goal=PKG_INSTALL) at rpmte.c:953
#8  0x40071089 in rpmtsProcess (ts=0x807cc70) at transaction.c:1395
#9  0x400712de in rpmtsRun (ts=0x807cc70, okProbs=0x0, ignoreSet=0) at transaction.c:1466
#10 0x4006010a in rpmcliTransaction (ts=0x807cc70, ia=0x400909a0 <rpmIArgs>, numPackages=1) at rpminstall.c:289
#11 0x40060e0b in rpmInstall (ts=0x807cc70, ia=0x400909a0 <rpmIArgs>, fileArgv=0x804d9f8) at rpminstall.c:589
#12 0x080499f3 in main (argc=4, argv=0xbffff4a4) at rpmqv.c:293
(gdb) p /x il
$28 = 0x6a
(gdb) p /x dl
$29 = 0x11df6b8

The question is whether this limit can be safely changed/increased?

If not, could it be possible to modify the code so that it would at least print out a little bit more meaningful error message?

Now it install all the files and just not updates the rpm database. Which results in a situation where it's not possible to uninstall the package (all already installed files) as it claims that the package is not installed.
Comment 1 Panu Matilainen 2013-07-09 01:49:57 EDT
See https://bugzilla.redhat.com/show_bug.cgi?id=706935#c2, this is the same except that newer rpm doesn't crash, it just silently fails (which is not a whole lot better).

Bumping up the limit would help but it wouldn't solve the actual problem: it'd still be possible to build a package which fails to install due to rpm itself causing the header becoming larger.

But yes, this needs fixing sooner than later.
Comment 2 Fedora End Of Life 2013-12-21 10:35:09 EST
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 3 Fedora End Of Life 2014-02-05 18:12:55 EST
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 4 Panu Matilainen 2014-02-06 01:42:33 EST
This wont help F18 anymore but just FWIW, an ages old flaw in rpm which got exposed in rpm >= 4.10 was just discovered. The flaw causes headers to appear much larger than they are on package install, causing this issue to occur even when the header does not actually exceed the size limit - see bug 953719.

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