]> git.saurik.com Git - apt.git/commitdiff
fix crash when P.Arch() was used but the cache got remapped
authorMichael Vogt <egon@debian-devbox>
Mon, 1 Aug 2011 13:32:16 +0000 (15:32 +0200)
committerMichael Vogt <egon@debian-devbox>
Mon, 1 Aug 2011 13:32:16 +0000 (15:32 +0200)
1  2 
apt-pkg/pkgcachegen.cc
debian/changelog

diff --combined apt-pkg/pkgcachegen.cc
index 2b6d294fbf79aab1fecf56ab274556e09a378410,2bfb776095f4a1deda5190d2a073bf450eb209dd..0e6ae698d39cf3e4b61bbffb8d3adc2ab0c0361e
@@@ -98,7 -98,6 +98,7 @@@ pkgCacheGenerator::~pkgCacheGenerator(
        return;
     
     Cache.HeaderP->Dirty = false;
 +   Cache.HeaderP->CacheFileSize = Map.Size();
     Map.Sync(0,sizeof(pkgCache::Header));
  }
                                                                        /*}}}*/
@@@ -637,7 -636,9 +637,9 @@@ bool pkgCacheGenerator::FinishCache(OpP
            Dynamic<pkgCache::VerIterator> DynV(V);
            for (; V.end() != true; V++)
            {
-              char const * const Arch = P.Arch();
+                // copy P.Arch() into a string here as a cache remap
+                // in NewDepends() later may alter the pointer location
+              string Arch = P.Arch() == NULL ? "" : P.Arch();
               map_ptrloc *OldDepLast = NULL;
               /* MultiArch handling introduces a lot of implicit Dependencies:
                - MultiArch: same → Co-Installable if they have the same version
               bool const coInstall = ((V->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same);
               for (vector<string>::const_iterator A = archs.begin(); A != archs.end(); ++A)
               {
 -                if (*A == Arch)
 +                if (Arch == 0 || *A == Arch)
                     continue;
                  /* We allow only one installed arch at the time
                     per group, therefore each group member conflicts
diff --combined debian/changelog
index 05502a92a9840ba1458976414de0cda868c7a7e1,e17b1abd01b37e6c770c52b3083b2f39b054c06a..2d3f1a9c923e3dc264743adb13bbcf269f9e3a9f
@@@ -1,36 -1,5 +1,37 @@@
 -apt (0.8.15.6) unstable; urgency=low
 +apt (0.8.16~exp5) UNRELEASED; urgency=low
  
-  -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 29 Jul 2011 13:44:01 +0200
 +  * apt-pkg/makefile:
 +    - install sha256.h compat header
 +  * apt-pkg/pkgcachegen.{cc,h}:
 +    - use ref-to-ptr semantic in NewDepends() to ensure that the   
 +      libapt does not segfault if the cache is remapped in between
 +      (LP: #812862)
++    - fix crash when P.Arch() was used but the cache got remapped
 +
++ -- Michael Vogt <mvo@debian.org>  Mon, 01 Aug 2011 15:31:55 +0200
 +
 +apt (0.8.16~exp4) experimental; urgency=low
 +
 +  [ Julian Andres Klode ]
 +  * apt-pkg/pkgcache.h:
 +    - [ABI break] Add pkgCache::Header::CacheFileSize, storing the cache size
 +  * apt-pkg/pkgcachegen.cc:
 +    - Write the file size to the cache
 +  * apt-pkg/pkgcache.cc:
 +    - Check that cache is at least CacheFileSize bytes large (LP: #16467)
 +  
 +  [ Michael Vogt ]
 +  * merged latest fixes from debian-sid
 +  * apt-pkg/cdrom.{cc,h}:
 +    - cleanup old ABI break avoidance hacks
 +  * [ABI break] apt-pkg/acquire-item.{cc,h}:
 +    - cleanup around OptionalIndexTarget and SubIndexTarget
 +  * [ABI break] merged patch from Jonathan Thomas to have a new
 +    RecordField() function in the pkgRecorder parser. Many thanks
 +    Thomas
 +  * [ABI break] merge patch from Jonathan Thomas to speed up the
 +    depcache by caching the install-recommends and install-suggests
 +    values
    * apt-pkg/contrib/fileutl.{cc,h}:
      - add GetModificationTime() helper
    * apt-pkg/pkgcachegen.cc:
        that changes in the ordering there will be honored by apt
    * apt-pkg/sourcelist.{cc,h}:
      - add pkgSourceList::GetLastModifiedTime() helper
 -  * apt-pkg/pkgcachegen.{cc,h}:
 -    - use ref-to-ptr semantic in NewDepends() to ensure that the   
 -      libapt does not segfault if the cache is remapped in between
 -      (LP: #812862)
  
 - -- Michael Vogt <mvo@debian.org>  Tue, 12 Jul 2011 11:54:47 +0200
 + -- Michael Vogt <mvo@debian.org>  Thu, 28 Jul 2011 16:57:08 +0200
 +
 +apt (0.8.16~exp3) experimental; urgency=low
 +
 +  [ David Kalnischkies ]
 +  * apt-pkg/pkgcache.h:
 +    - readd All{Foreign,Allowed} as suggested by Julian to
 +      remain strictly API compatible
 +  * apt-pkg/acquire*.{cc,h}:
 +    - try even harder to support really big files in the fetcher by
 +      converting (hopefully) everything to 'long long' (Closes: #632271)
 +  * ftparchive/writer.cc:
 +    - generate all checksums in one run over the file for Release
 +  * cmdline/apt-get.cc:
 +    - add an --assume-no option for testing to say 'no' to everything
 +  * apt-pkg/deb/debmetaindex.cc:
 +    - add trusted=yes option to mark unsigned (local) repository as trusted
 +      based on a patch from Ansgar Burchardt, thanks a lot! (Closes: #596498)
 +
 +  [ Michael Vogt ]
 +  * merge fixes from the debian/unstable upload
 +  * merge lp:~mvo/apt/sha512-template to get fixes for the 
 +    sha1/md5 verifiation (closes: #632520)
 +
 + -- Michael Vogt <mvo@debian.org>  Fri, 15 Jul 2011 09:56:17 +0200
 +
 +apt (0.8.16~exp2) experimental; urgency=low
 +
 +  [ David Kalnischkies ]
 +  * [ABI-Break] Implement EDSP in libapt-pkg so that all front-ends which
 +    use the internal resolver can now be used also with external
 +    ones as the usage is hidden in between the old API
 +  * provide two edsp solvers in apt-utils:
 +    - 'dump' to quickly output a complete scenario and
 +    - 'apt' to use the internal as an external resolver
 +  * apt-pkg/pkgcache.h:
 +    - clean up mess with the "all" handling in MultiArch to
 +      fix LP: #733741 cleanly for everyone now
 +  * apt-pkg/depcache.cc:
 +    - use a boolean instead of an int for Add/Remove in AddStates
 +      similar to how it works with AddSizes
 +    - let the Mark methods return if their marking was successful
 +    - if a Breaks can't be upgraded, remove it. If it or a Conflict
 +      can't be removed the installation of the breaker fails.
 +  * cmdline/apt-get.cc:
 +    - do not discard the error messages from the resolver and instead
 +      only show the general 'Broken packages' message if nothing else
 +
 +  [ Stefano Zacchiroli ]
 +  * doc/external-dependency-solver-protocol.txt:
 +    - describe EDSP and the configuration interface around it
 +  
 +  [ Michael Vogt ]
 +  * [ABI-Break] merge lp:~mvo/apt/sha512-template to add support for sha512
 +  * [ABI-Break] merge lp:~mvo/apt/dpointer to support easier extending
 +    without breaking the ABI
 +  * increase ABI version and update package names
 +
 + -- Michael Vogt <mvo@debian.org>  Wed, 29 Jun 2011 13:57:28 +0200
 +
 +apt (0.8.16~exp1) experimental; urgency=low
 +
 +  * merged with the debian/unstable upload
 +
 + -- Michael Vogt <mvo@debian.org>  Wed, 29 Jun 2011 12:40:31 +0200
  
- apt (0.8.15.5) UNRELEASED; urgency=low
+ apt (0.8.15.5) unstable; urgency=low
  
    [ David Kalnischkies ]
    * apt-pkg/deb/deblistparser.cc:
      - do not assume that the last char on a line is a \n (Closes: #633350)
  
-  -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 27 Jul 2011 23:25:45 +0200
+  -- Michael Vogt <mvo@debian.org>  Thu, 28 Jul 2011 16:49:15 +0200
  
  apt (0.8.15.4) unstable; urgency=low
  
@@@ -316,185 -225,6 +317,185 @@@ apt (0.8.15) unstable; urgency=lo
  
   -- Michael Vogt <mvo@debian.org>  Tue, 28 Jun 2011 18:00:48 +0200
  
 +apt (0.8.15~exp3) experimental; urgency=low
 +
 +  * debian/control:
 +    - add Breaks: 0.8.15~exp3) for libapt-pkg4.10 and 
 +     libapt-inst1.2 (thanks to Jonathan Nieder, closes: #630214)
 +    - use depends for the ${shlibs:Depends} to make the breaks work
 +
 + -- Michael Vogt <mvo@debian.org>  Fri, 17 Jun 2011 21:51:41 +0200
 +
 +apt (0.8.15~exp2) experimental; urgency=low
 +
 +  * debian/control:
 +    - fix incorrect Replaces (closes: #630204) for libapt-inst1.2
 +
 + -- Michael Vogt <mvo@debian.org>  Wed, 15 Jun 2011 16:51:14 +0200
 +
 +apt (0.8.15~exp1) experimental; urgency=low
 +
 +  [ Julian Andres Klode ]
 +  * apt-pkg/depcache.cc:
 +    - Really release action groups only once (Closes: #622744)
 +    - Make purge work again for config-files (LP: #244598) (Closes: #150831)
 +  * apt-pkg/acquire-item.cc:
 +    - Reject files known to be invalid (LP: #346386) (Closes: #627642)
 +  * debian/apt.cron.daily:
 +    - Check power after wait, patch by manuel-soto (LP: #705269)
 +  * debian/control:
 +    - Move ${shlibs:Depends} to Pre-Depends, as we do not want APT
 +      unpacked if a library is too old and thus break upgrades
 +  * doc/apt-key.8.xml:
 +    - Document apt-key net-update (LP: #192810)
 +
 +  [ Christian Perrier ]
 +  * Galician translation update (Miguel Anxo Bouzada). Closes: #626505
 +  * Italian translation update (Milo Casagrande). Closes: #627834
 +  * German documentation translation update (Chris Leick). Closes: #629949
 +
 +  [ David Kalnischkies ]
 +  * fix a bunch of cppcheck warnings/errors based on a patch by
 +    Niels Thykier, thanks! (Closes: #622805)
 +  * apt-pkg/depcache.cc:
 +    - really include 'rc' packages in the delete count by fixing a
 +      typo which exists since 1999 in the source… (LP: #761175)
 +    - if critical or-group can't be satisfied, exit directly.
 +  * apt-pkg/acquire-method.cc:
 +    - write directly to stdout instead of creating the message in
 +      memory first before writing to avoid hitting limits
 +    - fix order of CurrentURI and UsedMirror in Status() and Log()
 +  * apt-pkg/orderlist.cc:
 +    - let VisitRProvides report if the calls were successful
 +  * apt-pkg/deb/dpkgpm.cc:
 +    - replace obsolete usleep with nanosleep
 +  * debian/apt{,-utils}.symbols:
 +    - update both experimental symbol-files to reflect 0.8.14 state
 +  * debian/rules:
 +    - remove unused embedded jquery by doxygen from libapt-pkg-doc
 +  * cmdline/apt-mark.cc:
 +    - reimplement apt-mark in c++
 +    - provide a 'showmanual' command (Closes: #582791)
 +    - provide a 'dpkg --set-selections' wrapper to set/release holds
 +  * cmdline/apt-get.cc:
 +    - deprecate mostly undocumented 'markauto' in favor of 'apt-mark'
 +  * cmdline/apt-cache.cc:
 +    - deprecate mostly undocumented 'showauto' in favor of 'apt-mark'
 +  * apt-pkg/pkgcache.cc:
 +    - really ignore :arch in FindPkg() in non-multiarch environment
 +  * doc/po/de.po:
 +    - undo the translation of the command 'dump' in manpage of apt-config
 +      as report by Burghard Grossmann on debian-l10n-german, thanks!
 +  * apt-pkg/deb/debmetaindex.cc:
 +    - do not download TranslationIndex if no Translation-* will be
 +      downloaded later on anyway (Closes: #624218)
 +  * test/versions.lst:
 +    - disable obscure version number tests with versions dpkg doesn't
 +      allow any more as they don't start with a number
 +  * apt-pkg/acquire-worker.cc:
 +    - print filename in the unmatching size warning (Closes: #623137)
 +  * apt-pkg/acquire-item.cc:
 +    - apply fix for poorly worded 'locate file' error message from
 +      Ben Finney, thanks! (Closes: #623171)
 +  * methods/http.cc:
 +    - add config option to ignore a closed stdin to be able to easily
 +      use the method as a simple standalone downloader
 +    - Location header in redirects should be absolute URI, but some
 +      servers just send an absolute path so still deal with it properly
 +    - dequote URL taken from Location in redirects as we will otherwise
 +      quote an already quoted string in the request later (Closes: #602412)
 +  * apt-pkg/contrib/netrc.cc:
 +    - replace non-posix gnu-extension strdupa with strdup
 +  * apt-pkg/packagemanager.cc:
 +    - ensure for Multi-Arch:same packages that they are unpacked in
 +      lock step even in immediate configuration (Closes: #618288)
 +
 +  [ Michael Vogt ]
 +  * methods/mirror.cc:
 +    - ignore lines starting with "#" in the mirror file
 +    - ignore non http urls in the mirrors
 +    - append the dist (e.g. sid, wheezy) as a query string when
 +      asking for a suitable mirror 
 +  * debian/control:
 +    - add libapt-pkg4.10 and libapt-inst1.2 library packages
 +
 + -- Michael Vogt <mvo@debian.org>  Fri, 10 Jun 2011 15:32:07 +0200
 +
 +apt (0.8.14.2) UNRELEASED; urgency=low
 +
 +  [ Julian Andres Klode ]
 +  * apt-pkg/depcache.cc:
 +    - Really release action groups only once (Closes: #622744)
 +    - Make purge work again for config-files (LP: #244598) (Closes: #150831)
 +  * debian/apt.cron.daily:
 +    - Check power after wait, patch by manuel-soto (LP: #705269)
 +  * debian/control:
 +    - Move ${shlibs:Depends} to Pre-Depends, as we do not want APT
 +      unpacked if a library is too old and thus break upgrades
 +  * doc/apt-key.8.xml:
 +    - Document apt-key net-update (LP: #192810)
 +
 +  [ Christian Perrier ]
 +  * Galician translation update (Miguel Anxo Bouzada). Closes: #626505
 +
 +  [ David Kalnischkies ]
 +  * fix a bunch of cppcheck warnings/errors based on a patch by
 +    Niels Thykier, thanks! (Closes: #622805)
 +  * apt-pkg/depcache.cc:
 +    - really include 'rc' packages in the delete count by fixing a
 +      typo which exists since 1999 in the source… (LP: #761175)
 +    - if critical or-group can't be satisfied, exit directly.
 +  * apt-pkg/acquire-method.cc:
 +    - write directly to stdout instead of creating the message in
 +      memory first before writing to avoid hitting limits
 +    - fix order of CurrentURI and UsedMirror in Status() and Log()
 +  * apt-pkg/orderlist.cc:
 +    - let VisitRProvides report if the calls were successful
 +  * apt-pkg/deb/dpkgpm.cc:
 +    - replace obsolete usleep with nanosleep
 +  * debian/apt{,-utils}.symbols:
 +    - update both experimental symbol-files to reflect 0.8.14 state
 +  * debian/rules:
 +    - remove unused embedded jquery by doxygen from libapt-pkg-doc
 +  * cmdline/apt-mark.cc:
 +    - reimplement apt-mark in c++
 +    - provide a 'showmanual' command (Closes: #582791)
 +    - provide a 'dpkg --set-selections' wrapper to set/release holds
 +  * cmdline/apt-get.cc:
 +    - deprecate mostly undocumented 'markauto' in favor of 'apt-mark'
 +  * cmdline/apt-cache.cc:
 +    - deprecate mostly undocumented 'showauto' in favor of 'apt-mark'
 +  * apt-pkg/pkgcache.cc:
 +    - really ignore :arch in FindPkg() in non-multiarch environment
 +  * doc/po/de.po:
 +    - undo the translation of the command 'dump' in manpage of apt-config
 +      as report by Burghard Grossmann on debian-l10n-german, thanks!
 +  * apt-pkg/deb/debmetaindex.cc:
 +    - do not download TranslationIndex if no Translation-* will be
 +      downloaded later on anyway (Closes: #624218)
 +  * test/versions.lst:
 +    - disable obscure version number tests with versions dpkg doesn't
 +      allow any more as they don't start with a number
 +  * apt-pkg/acquire-worker.cc:
 +    - print filename in the unmatching size warning (Closes: #623137)
 +  * apt-pkg/acquire-item.cc:
 +    - apply fix for poorly worded 'locate file' error message from
 +      Ben Finney, thanks! (Closes: #623171)
 +  * methods/http.cc:
 +    - add config option to ignore a closed stdin to be able to easily
 +      use the method as a simple standalone downloader
 +    - Location header in redirects should be absolute URI, but some
 +      servers just send an absolute path so still deal with it properly
 +    - dequote URL taken from Location in redirects as we will otherwise
 +      quote an already quoted string in the request later (Closes: #602412)
 +  * apt-pkg/contrib/netrc.cc:
 +    - replace non-posix gnu-extension strdupa with strdup
 +  * apt-pkg/packagemanager.cc:
 +    - ensure for Multi-Arch:same packages that they are unpacked in
 +      lock step even in immediate configuration (Closes: #618288)
 +
 + -- Michael Vogt <mvo@debian.org>  Mon, 16 May 2011 14:57:52 +0200
 +
  apt (0.8.14.1) unstable; urgency=low
  
    * apt-pkg/acquire-item.cc: