Bug 531243 - negative values for sizes >2gb
Summary: negative values for sizes >2gb
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-27 13:34 UTC by Serge Pavlovsky
Modified: 2014-01-21 23:11 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-10 12:28:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Serge Pavlovsky 2009-10-27 13:34:03 UTC
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

Comment 1 seth vidal 2009-10-27 14:04:41 UTC
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.

Comment 2 Serge Pavlovsky 2009-10-27 14:15:53 UTC
[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

Comment 3 Serge Pavlovsky 2009-10-27 14:16:52 UTC
[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

Comment 4 Panu Matilainen 2009-10-27 14:32:24 UTC
(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.

Comment 5 seth vidal 2009-10-27 14:36:34 UTC
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.

Comment 6 seth vidal 2009-10-27 14:46:02 UTC
definitely in rpm-python for this part of this one. I'll see if I can come up with a sensible answer.

Comment 7 Panu Matilainen 2009-10-27 15:27:27 UTC
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.

Comment 8 Serge Pavlovsky 2009-10-27 15:50:54 UTC
my system is 64bit, im just installing 32bit package

Comment 9 seth vidal 2009-10-27 16:24:46 UTC
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.

Comment 10 Bug Zapper 2009-11-16 14:24:56 UTC
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

Comment 11 Fedora Update System 2009-12-08 12:47:25 UTC
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

Comment 12 Fedora Update System 2009-12-10 04:19:08 UTC
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

Comment 13 Panu Matilainen 2010-08-10 12:28:32 UTC
Closing this, the update got long since published but bodhi seems to have hickuped or something...


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