[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#400768: Requires an ABI change



The attached patch breaks libapt's ABI, so I suggest it be kept
to developer's chroots and test systems for a while.

It might be possible to fix the problem of German using more
descriptions than English without changing the ABI; but I haven't
looked in to how hard it would be to do so.  I'm guessing that it
would be fiddly, and difficult to do safely for Lenny.



There are four separate "Wow, you exceeded ..." messages, one for
each of
    packages
    versions
    descriptions
    dependencies
The dependencies limit seems to apply to unused code[1], and is
in any case already 2**32-1.  The other three are limited to
65535 objects of each type.

Apt uses unsigned short identifiers (which are 16-bit on all
current Debian architectures) for these, and this is visibly
exported in the ABI of libapt.  The only way to change it is to
change the ABI.


With the attached patch, and after recompiling aptitude to the new
ABI, aptitude is happy to see eight Debian or Ubuntu releases.
apt-cache stats, for English and German:
Total package names: 41665
Total distinct versions: 133926
Total distinct descriptions: 133926
Total dependencies: 947896
Gesamtzahl an Paketnamen: 41806
Gesamtzahl an unterschiedlichen Versionen: 133926
Gesamtzahl an unterschiedlichen Beschreibungen: 240377
Gesamtzahl an Abh?gigkeiten: 947896


The error-checking code that outputs the "Wow..." messages is
based on sizeof(), and will automatically switch to a limit of
2**32-1 if 32-bit identifiers are used.

Steve


[1] A breakpoint on pkgCacheGenerator::ListParser::NewDepends
wasn't hit by basic usage of either apt-get or aptitude.

 ________________________________________
/ Attached patch causes ABI breakage of  \
| the package system? That's serious     |
\ enough to justify a warning in cowsay. /
 ----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
Tue Sep 16 07:16:53 BST 2008  Steve Cotton <steve@s.cotton.clara.co.uk>
  * 400768: Use ints instead of shorts for ID fields (breaks ABI)
  Increases limits on number of packages, versions and descriptions
  from 2**16-1 to 2**32-1.
diff -rN -u old-apt-0.7.14.steve.1/apt-pkg/pkgcache.h new-apt-0.7.14.steve.1/apt-pkg/pkgcache.h
--- old-apt-0.7.14.steve.1/apt-pkg/pkgcache.h	2008-09-16 07:26:58.000000000 +0100
+++ new-apt-0.7.14.steve.1/apt-pkg/pkgcache.h	2008-09-16 07:26:58.000000000 +0100
@@ -214,7 +214,7 @@
    unsigned char InstState;         // Flags
    unsigned char CurrentState;      // State
    
-   unsigned short ID;
+   unsigned int ID;
    unsigned long Flags;
 };
 
@@ -235,7 +235,7 @@
    
    // Linked list
    map_ptrloc NextFile;        // PackageFile
-   unsigned short ID;
+   unsigned int ID;
    time_t mtime;                  // Modification time for the file
 };
 
@@ -272,7 +272,7 @@
    map_ptrloc Size;              // These are the .deb size
    map_ptrloc InstalledSize;
    unsigned short Hash;
-   unsigned short ID;
+   unsigned int ID;
    unsigned char Priority;
 };
 
@@ -289,7 +289,7 @@
    map_ptrloc NextDesc;          // Description
    map_ptrloc ParentPkg;         // Package
 
-   unsigned short ID;
+   unsigned int ID;
 };
 
 struct pkgCache::Dependency


Reply to: