Bug 110556 - Installing/Upgrading the attach packages causes a non-zero return code
Installing/Upgrading the attach packages causes a non-zero return code
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
9
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-21 00:43 EST by Mark Hatle
Modified: 2007-04-18 12:59 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-18 09:23:41 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
binary rpm package that exhibits the behavior (80.12 KB, application/octet-stream)
2003-11-21 09:16 EST, Mark Hatle
no flags Details

  None (edit)
Description Mark Hatle 2003-11-21 00:43:31 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/103u (KHTML, like Gecko) Safari/100.1

Description of problem:
Working with jbj in IRC the problem was identified (in rpm 4.1) to be the erase in lib/psm.c failed.  Unfortunatly this doesn't seem to be the problem but a symptom of a deeper problem.

       psm->mi = rpmdbFreeIterator(psm->mi);
       rc = (fi->h ? RPMRC_OK : RPMRC_FAIL);

fi->h comes back NULL.  This is in lib/psm.c, user the case for PSM_RPMDB_LOAD, in the function rpmpsmStage.

The same behavior is happening on the stock RH 9.0 rpm 4.2 version listed above.

When doing an rpm -U --replacepkgs on a particular package, twice in a row the second (and subsequant) operations yield a non-zero return code.

Version-Release number of selected component (if applicable):
rpm-4.2-0.69

How reproducible:
Always

Steps to Reproduce:
1. mkdir -p /tmp/testing/var/lib/rpm
2. rpm --root /tmp -Uhv --ignorearch --nodeps --replacepkgs mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl ; echo $?
3. (repeat the above line)
    

Actual Results:  The first time the return code is "0".  The second and subseqent times the return code is != "0".  (in this case it's 1 because we had "one" package failure.)

Expected Results:  0 return code both times

Additional info:

What appears to be happening is the update does the install/remove correctly in the database.  But somehow adds a PKGERASE action.  When it gets to that stage the header key is no longer in the rpm database, so the iterator fails.. causing the failure to be carried down the calling chain.
Comment 1 Jeff Johnson 2003-11-21 07:38:01 EST
I see no pkg attached. Could you attach the pkg in question please?
Comment 2 Mark Hatle 2003-11-21 09:16:27 EST
Created attachment 96118 [details]
binary rpm package that exhibits the behavior
Comment 3 Jeff Johnson 2006-01-06 09:27:48 EST
Reproduced with rpm-4.4.5:

[root@wellfleet tmp]# rpm --root /tmp -Uhv --ignorearch --nodeps --replacepkgs 
mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl ; echo $?
Preparing...                ########################################### [100%]
   1:mvlutils               ########################################### [100%]
0
[root@wellfleet tmp]# rpm --root /tmp -Uhv --ignorearch --nodeps --replacepkgs 
mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl ; echo $?
Preparing...                ########################################### [100%]
   1:mvlutils               ########################################### [100%]
1
Comment 4 Jeff Johnson 2006-01-27 03:54:59 EST
Hmmm, the link count field for certain files in the package is zero, that should not be happening:

[jbj@wellfleet X]$ rpm -qlvp mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl 
-rwxr-xr-x    0 root    root            27930 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/mktemp
-rwxr-xr-x    0 root    root            27063 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/readlink
-rwxr-xr-x    1 root    root            43950 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/run-parts
-rwxr-xr-x    0 root    root            30793 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/tempfile
-rwxr-xr-x    1 root    root            12853 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/usleep
lrwxrwxrwx    1 root    root               26 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/vi -> ../usr/bin/sensible-editor
-rwxr-xr-x    1 root    root            25388 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/sbin/start-stop-daemon
lrwxrwxrwx    1 root    root               15 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/editor -> sensible-editor
lrwxrwxrwx    1 root    root               14 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/pager -> sensible-pager
-rwxr-xr-x    1 root    root             6318 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/savelog
-rwxr-xr-x    1 root    root              674 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/sensible-editor
-rwxr-xr-x    1 root    root              533 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/sensible-pager
-rw-r--r--    1 root    root             2097 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/lib/pml/packages/mvlutils
-rwxr-xr-x    1 root    root            25701 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/initdconfig
lrwxrwxrwx    1 root    root               11 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/pentium2-initdconfig -> initdconfig
lrwxrwxrwx    1 root    root               11 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/pentium2-shellconfig -> shellconfig
-rwxr-xr-x    1 root    root            30017 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/shellconfig
drwxr-xr-x    2 root    root                0 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/share/doc/mvlutils-1.14
-rw-r--r--    0 root    root             8115 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/share/doc/mvlutils-1.14/LICENSE
Comment 5 Jeff Johnson 2006-03-18 09:23:41 EST
I'm going to assume this is a build environment problem because of the link count
problems. Please reopen if you think I'm guessing wrong.

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