RPM

negative values for sizes >2gb

Bug #638611 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RPM
New
Undecided
Unassigned
Fedora
Fix Released
Medium

Bug Description

tracker

Tags: fedora python
Revision history for this message
In , Serge (serge-redhat-bugs) wrote :

Steps to Reproduce:
1. yum localinstall 3gb rpm

Actual results:
yum prints Size -1075798307.0, Total size: -1075605535

Expected results:

positive values in 3gb range

Revision history for this message
In , seth (seth-redhat-bugs) wrote :

oooo - that looks like fun.

Can you cut and paste the whole output you're seeing - I want to make sure I have the context right.

also could you run:

rpm -qpi 3gb.rpm and paste that output, too.

Revision history for this message
In , Serge (serge-redhat-bugs) wrote :

[root@localhost i686]# yum localinstall quake4-1.4.2-3pal.i686.rpm
Loaded plugins: aliases, auto-update-debuginfo, basearchonly, changelog, downloadonly, fastestmirror, filter-data, keys, list-data, merge-conf, post-transaction-actions, presto,
              : priorities, protect-packages, protectbase, refresh-packagekit, refresh-updatesd, remove-with-leaves, rpm-warm-cache, security, show-leaves, tmprepo, tsflags, upgrade-
              : helper, verify, versionlock
Setting up Local Package Process
Examining quake4-1.4.2-3pal.i686.rpm: quake4-1.4.2-3pal.i686
Marking quake4-1.4.2-3pal.i686.rpm to be installed
Found 128 installed debuginfo package(s)
0 packages excluded due to repository protections
Loading mirror speeds from cached hostfile
 * rawhide: mirror.karneval.cz
 * rawhide-debuginfo: mirror.karneval.cz
 * rpmfusion-free-rawhide: mirror.karneval.cz
 * rpmfusion-free-rawhide-debuginfo: ftp-stud.hs-esslingen.de
 * rpmfusion-nonfree-rawhide: mirror.karneval.cz
 * rpmfusion-nonfree-rawhide-debuginfo: mirror.karneval.cz
0 packages excluded due to repository protections
Resolving Dependencies
--> Running transaction check
---> Package quake4.i686 0:1.4.2-3pal set to be updated
--> Processing Dependency: libSDL-1.2.so.0 for package: quake4-1.4.2-3pal.i686
--> Running transaction check
---> Package SDL.i686 0:1.2.13-10.fc12 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================
 Package Арх. Версия Repository Size
===========================================================================================================================================================================================
Installing:
 quake4 i686 1.4.2-3pal /quake4-1.4.2-3pal.i686 -1075798307.0
Installing for dependencies:
 SDL i686 1.2.13-10.fc12 rawhide 188 k

Transaction Summary
===========================================================================================================================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)

Total size: -1075605535
Total download size: 188 k
Выполнить [y/N]: y

Revision history for this message
In , Serge (serge-redhat-bugs) wrote :

[root@localhost i686]# rpm -qpi quake4-1.4.2-3pal.i686.rpm
Name : quake4 Relocations: (not relocatable)
Version : 1.4.2 Vendor: (none)
Release : 3pal Build Date: Вск 09 Авг 2009 16:44:15
Install Date: (not installed) Build Host: vpn-107-53.tenet.odessa.ua
Group : Amusements/Games Source RPM: quake4-1.4.2-3pal.src.rpm
Size : 3219168989 License: Proprietary
Signature : (none)
URL : http://www.idsoftware.com/
Summary : Quake 4
Description :
Quake 4

Revision history for this message
In , Panu (panu-redhat-bugs) wrote :

(In reply to comment #1)
> oooo - that looks like fun.

This is indeed going to be fun on several fronts... some of it in createrepo and yum which seem to assume int() for size in various places, and some in rpm-python which doesn't deal with signed/unsigned issues either.

And then there's the land beyond 4GB sizes which isn't dealt with at all on the python side of things currently, but that's another (but related) story.

Revision history for this message
In , seth (seth-redhat-bugs) wrote :

well changing it in yum should fix createrepo but in this case it is just in yum/rpm-python afaict b/c this pkg is being localinstalled.

I'm building myself a 3gb rpm to see what all falls apart.

Revision history for this message
In , seth (seth-redhat-bugs) wrote :

definitely in rpm-python for this part of this one. I'll see if I can come up with a sensible answer.

Revision history for this message
In , Panu (panu-redhat-bugs) wrote :

The issue (well, one of them) is that python integers are always signed, whereas rpm itself mostly deals with unsigned (32bit) integers. Hardly an issue on 64bit systems but on 32bit systems you get results like this.

To fix it, rpm-python needs to start returning python longs instead of ints, which in turn will break anything assuming integers or have some less dramatic side-effects like unexpected L's in output etc.

Revision history for this message
In , Serge (serge-redhat-bugs) wrote :

my system is 64bit, im just installing 32bit package

Revision history for this message
In , seth (seth-redhat-bugs) wrote :

This patch seems to work
--- a/python/header-py.c~ 2009-06-23 07:40:59.000000000 -0400
+++ b/python/header-py.c 2009-10-27 12:07:08.000000000 -0400
@@ -390,13 +390,13 @@
    if (count != 1 || forceArray) {
        metao = PyList_New(0);
        for (i = 0; i < count; i++) {
- o = PyInt_FromLong(((int *) data)[i]);
+ o = PyLong_FromUnsignedLong(((int *) data)[i]);
        PyList_Append(metao, o);
        Py_DECREF(o);
        }
        o = metao;
    } else {
- o = PyInt_FromLong(*((int *) data));
+ o = PyLong_FromUnsignedLong(*((int *) data));
    }
    break;

I've tested installs and queries and createrepo and all of them seem to return the right info.

Revision history for this message
In , Bug (bug-redhat-bugs) wrote :

This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

rpm-4.7.2-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/rpm-4.7.2-1.fc12

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

rpm-4.7.2-1.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update rpm'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12988

Revision history for this message
In , Panu (panu-redhat-bugs) wrote :

Closing this, the update got long since published but bodhi seems to have hickuped or something...

Jeff Johnson (n3npq)
tags: added: fedora python
Changed in rpm:
milestone: none → 4.7.2
Changed in fedora:
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.