Debian Bug report logs - #812251
apt: suddenly segfaults after "apt update"

version graph

Package: apt; Maintainer for apt is APT Development Team <deity@lists.debian.org>; Source for apt is src:apt (PTS, buildd, popcon).

Reported by: Sven Hartge <sven@svenhartge.de>

Date: Thu, 21 Jan 2016 23:33:05 UTC

Severity: important

Found in versions apt/1.2.3, apt/1.2

Fixed in versions apt/1.2.1, apt/1.2.5

Done: Julian Andres Klode <jak@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Thu, 21 Jan 2016 23:33:09 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Hartge <sven@svenhartge.de>:
New Bug report received and forwarded. Copy sent to APT Development Team <deity@lists.debian.org>. (Thu, 21 Jan 2016 23:33:09 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Sven Hartge <sven@svenhartge.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: apt: suddenly segfaults after "apt update"
Date: Fri, 22 Jan 2016 00:31:28 +0100
[Message part 1 (text/plain, inline)]
Package: apt
Version: 1.2
Severity: important

Hi!

This is Debian Sid on a Cubietruck.

Today, suddenly, apt, apt-get and aptitude all segfault after the recent
update to the package lists.

 "apt update" works but segfaults at the end during "Reading package lists ..."

 "apt-get update" the same (unsurprising)

 "aptitude update" segfaults immediately (after running a bit, but
 before downloading anything)

 "gdb aptitude update" on the other hand segfaults after downloading
 something. (Weird. Heisebug?)

I am attaching backtraces for both apt and aptitude.

(If you need the contents of /var/lib/apt* and /var/lib/dpkg/status I 
can make those available via seperate download.

Grüße,
Sven.

-- Package-specific info:

-- apt-config dump --

APT "";
APT::Architecture "armhf";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "1";
APT::Install-Suggests "0";
APT::Sandbox "";
APT::Sandbox::User "_apt";
APT::Authentication "";
APT::Authentication::TrustCDROM "true";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^firmware-linux.*";
APT::NeverAutoRemove:: "^linux-firmware$";
APT::NeverAutoRemove:: "^linux-image-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-image-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-headers-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-headers-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-image-extra-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-image-extra-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-signed-image-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-signed-image-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^kfreebsd-image-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^kfreebsd-image-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^kfreebsd-headers-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^kfreebsd-headers-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^gnumach-image-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^gnumach-image-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^.*-modules-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^.*-modules-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^.*-kernel-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^.*-kernel-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-backports-modules-.*-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-backports-modules-.*-4\.3\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-tools-4\.2\.0-1-armmp-lpae$";
APT::NeverAutoRemove:: "^linux-tools-4\.3\.0-1-armmp-lpae$";
APT::VersionedKernelPackages "";
APT::VersionedKernelPackages:: "linux-image";
APT::VersionedKernelPackages:: "linux-headers";
APT::VersionedKernelPackages:: "linux-image-extra";
APT::VersionedKernelPackages:: "linux-signed-image";
APT::VersionedKernelPackages:: "kfreebsd-image";
APT::VersionedKernelPackages:: "kfreebsd-headers";
APT::VersionedKernelPackages:: "gnumach-image";
APT::VersionedKernelPackages:: ".*-modules";
APT::VersionedKernelPackages:: ".*-kernel";
APT::VersionedKernelPackages:: "linux-backports-modules-.*";
APT::VersionedKernelPackages:: "linux-tools";
APT::Never-MarkAuto-Sections "";
APT::Never-MarkAuto-Sections:: "metapackages";
APT::Never-MarkAuto-Sections:: "contrib/metapackages";
APT::Never-MarkAuto-Sections:: "non-free/metapackages";
APT::Never-MarkAuto-Sections:: "restricted/metapackages";
APT::Never-MarkAuto-Sections:: "universe/metapackages";
APT::Never-MarkAuto-Sections:: "multiverse/metapackages";
APT::Move-Autobit-Sections "";
APT::Move-Autobit-Sections:: "oldlibs";
APT::Move-Autobit-Sections:: "contrib/oldlibs";
APT::Move-Autobit-Sections:: "non-free/oldlibs";
APT::Move-Autobit-Sections:: "restricted/oldlibs";
APT::Move-Autobit-Sections:: "universe/oldlibs";
APT::Move-Autobit-Sections:: "multiverse/oldlibs";
APT::Keep-Downloaded-Packages "true";
APT::Get "";
APT::Get::Show-Upgraded "true";
APT::Get::Show-Recommends "yes";
APT::Get::Show-Suggests "yes";
APT::Architectures "";
APT::Architectures:: "armhf";
APT::Compressor "";
APT::Compressor::. "";
APT::Compressor::.::Name ".";
APT::Compressor::.::Extension "";
APT::Compressor::.::Binary "";
APT::Compressor::.::Cost "0";
APT::Compressor::lz4 "";
APT::Compressor::lz4::Name "lz4";
APT::Compressor::lz4::Extension ".lz4";
APT::Compressor::lz4::Binary "false";
APT::Compressor::lz4::Cost "50";
APT::Compressor::gzip "";
APT::Compressor::gzip::Name "gzip";
APT::Compressor::gzip::Extension ".gz";
APT::Compressor::gzip::Binary "gzip";
APT::Compressor::gzip::Cost "100";
APT::Compressor::gzip::CompressArg "";
APT::Compressor::gzip::CompressArg:: "-6n";
APT::Compressor::gzip::UncompressArg "";
APT::Compressor::gzip::UncompressArg:: "-d";
APT::Compressor::xz "";
APT::Compressor::xz::Name "xz";
APT::Compressor::xz::Extension ".xz";
APT::Compressor::xz::Binary "xz";
APT::Compressor::xz::Cost "200";
APT::Compressor::xz::CompressArg "";
APT::Compressor::xz::CompressArg:: "-6";
APT::Compressor::xz::UncompressArg "";
APT::Compressor::xz::UncompressArg:: "-d";
APT::Compressor::bzip2 "";
APT::Compressor::bzip2::Name "bzip2";
APT::Compressor::bzip2::Extension ".bz2";
APT::Compressor::bzip2::Binary "bzip2";
APT::Compressor::bzip2::Cost "300";
APT::Compressor::bzip2::CompressArg "";
APT::Compressor::bzip2::CompressArg:: "-6";
APT::Compressor::bzip2::UncompressArg "";
APT::Compressor::bzip2::UncompressArg:: "-d";
APT::Compressor::lzma "";
APT::Compressor::lzma::Name "lzma";
APT::Compressor::lzma::Extension ".lzma";
APT::Compressor::lzma::Binary "xz";
APT::Compressor::lzma::Cost "400";
APT::Compressor::lzma::CompressArg "";
APT::Compressor::lzma::CompressArg:: "--format=lzma";
APT::Compressor::lzma::CompressArg:: "-6";
APT::Compressor::lzma::UncompressArg "";
APT::Compressor::lzma::UncompressArg:: "--format=lzma";
APT::Compressor::lzma::UncompressArg:: "-d";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::mirrors "mirrors/";
Dir::State::extended_states "extended_states";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::netrc "auth.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Etc::preferencesparts "preferences.d";
Dir::Etc::trusted "trusted.gpg";
Dir::Etc::trustedparts "trusted.gpg.d";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::solvers "";
Dir::Bin::solvers:: "/usr/lib/apt/solvers";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Bin::bzip2 "/bin/bzip2";
Dir::Bin::xz "/usr/bin/xz";
Dir::Bin::lz4 "/usr/bin/lz4";
Dir::Bin::lzma "/usr/bin/xz";
Dir::Media "";
Dir::Media::MountPath "/media/cdrom";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";
Acquire "";
Acquire::AllowInsecureRepositories "1";
Acquire::AllowDowngradeToInsecureRepositories "0";
Acquire::cdrom "";
Acquire::cdrom::mount "/media/cdrom";
Acquire::IndexTargets "";
Acquire::IndexTargets::deb "";
Acquire::IndexTargets::deb::Packages "";
Acquire::IndexTargets::deb::Packages::MetaKey "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages";
Acquire::IndexTargets::deb::Packages::flatMetaKey "Packages";
Acquire::IndexTargets::deb::Packages::ShortDescription "Packages";
Acquire::IndexTargets::deb::Packages::Description "$(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
Acquire::IndexTargets::deb::Packages::flatDescription "$(RELEASE) Packages";
Acquire::IndexTargets::deb::Packages::Optional "0";
Acquire::IndexTargets::deb::Translations "";
Acquire::IndexTargets::deb::Translations::MetaKey "$(COMPONENT)/i18n/Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::flatMetaKey "$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::ShortDescription "Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::Description "$(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::flatDescription "$(RELEASE) Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb-src "";
Acquire::IndexTargets::deb-src::Sources "";
Acquire::IndexTargets::deb-src::Sources::MetaKey "$(COMPONENT)/source/Sources";
Acquire::IndexTargets::deb-src::Sources::flatMetaKey "Sources";
Acquire::IndexTargets::deb-src::Sources::ShortDescription "Sources";
Acquire::IndexTargets::deb-src::Sources::Description "$(RELEASE)/$(COMPONENT) Sources";
Acquire::IndexTargets::deb-src::Sources::flatDescription "$(RELEASE) Sources";
Acquire::IndexTargets::deb-src::Sources::Optional "0";
Acquire::Changelogs "";
Acquire::Changelogs::URI "";
Acquire::Changelogs::URI::Origin "";
Acquire::Changelogs::URI::Origin::Debian "http://metadata.ftp-master.debian.org/changelogs/@CHANGEPATH@_changelog";
Acquire::Changelogs::URI::Origin::Tanglu "http://metadata.tanglu.org/changelogs/@CHANGEPATH@_changelog";
Acquire::Changelogs::URI::Origin::Ubuntu "http://changelogs.ubuntu.com/changelogs/pool/@CHANGEPATH@/changelog";
Acquire::Changelogs::URI::Origin::Ultimedia "http://packages.ultimediaos.com/changelogs/pool/@CHANGEPATH@/changelog.txt";
Acquire::Languages "";
Acquire::Languages:: "none";
DPkg "";
DPkg::Pre-Invoke "";
DPkg::Pre-Invoke:: "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi";
DPkg::Post-Invoke:: "test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/apt-listbugs apt";
DPkg::Pre-Install-Pkgs:: "/usr/bin/apt-listchanges --apt || test $? -ne 10";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Tools "";
DPkg::Tools::Options "";
DPkg::Tools::Options::/usr/sbin/apt-listbugs "";
DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "3";
DPkg::Tools::Options::/usr/sbin/apt-listbugs::InfoFD "20";
DPkg::Tools::Options::/usr/bin/apt-listchanges "";
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
RPM "";
RPM::Pre-Invoke "";
RPM::Pre-Invoke:: "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi";
RPM::Post-Invoke "";
RPM::Post-Invoke:: "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi";
AptListbugs "";
AptListbugs::Severities "critical,grave,serious";
Aptitude "";
Aptitude::ProblemResolver "";
Aptitude::ProblemResolver::SolutionCost "removals";
Binary "apt-config";
Binary::apt "";
Binary::apt::APT "";
Binary::apt::APT::Color "1";
Binary::apt::APT::Cache "";
Binary::apt::APT::Cache::Show "";
Binary::apt::APT::Cache::Show::Version "2";
Binary::apt::APT::Cache::AllVersions "0";
Binary::apt::APT::Cache::ShowVirtuals "1";
Binary::apt::APT::Cache::Search "";
Binary::apt::APT::Cache::Search::Version "2";
Binary::apt::APT::Cache::ShowDependencyType "1";
Binary::apt::APT::Cache::ShowVersion "1";
Binary::apt::APT::Get "";
Binary::apt::APT::Get::Upgrade-Allow-New "1";
Binary::apt::APT::Cmd "";
Binary::apt::APT::Cmd::Show-Update-Stats "1";
Binary::apt::APT::Keep-Downloaded-Packages "0";
Binary::apt::DPkg "";
Binary::apt::DPkg::Progress-Fancy "1";
Binary::apt::Acquire "";
Binary::apt::Acquire::AllowInsecureRepositories "0";
CommandLine "";
CommandLine::AsString "apt-config dump";

-- (no /etc/apt/preferences present) --


-- /etc/apt/sources.list --

deb https://ds9.feds.oweh.org/debian/ unstable/
deb-src https://ds9.feds.oweh.org/debian/ unstable/

deb https://ds9.feds.oweh.org/debian/ experimental/
deb-src https://ds9.feds.oweh.org/debian/ experimental/

deb http://ftp.de.debian.org/debian testing main contrib non-free
deb-src http://ftp.de.debian.org/debian testing main contrib non-free

deb http://ftp.de.debian.org/debian sid main contrib non-free
deb-src http://ftp.de.debian.org/debian sid main contrib non-free

deb http://debug.mirrors.debian.org/debian-debug/ unstable-debug main

deb http://ftp.de.debian.org/debian experimental main contrib non-free
deb-src http://ftp.de.debian.org/debian experimental main contrib non-free

deb http://debug.mirrors.debian.org/debian-debug/ experimental-debug main

deb http://deb-multimedia.org sid main non-free
deb-src http://deb-multimedia.org sid main non-free

# EOF

-- System Information:
Debian Release: stretch/sid
Architecture: armhf (armv7l)

Kernel: Linux 4.3.0-1-armmp-lpae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt depends on:
ii  adduser                 3.113+nmu3
ii  debian-archive-keyring  2014.3
ii  gnupg                   1.4.20-1
ii  gnupg2                  2.1.10-3
ii  gpgv                    1.4.20-1
ii  libapt-pkg5.0           1.2
ii  libc6                   2.21-6
ii  libgcc1                 1:5.3.1-6
ii  libstdc++6              5.3.1-6

apt recommends no packages.

Versions of packages apt suggests:
pn  apt-doc     <none>
ii  aptitude    0.7.5-3
ii  dpkg-dev    1.18.4
ii  python-apt  1.1.0~beta1

-- no debconf information
[apt-segfault-2016-01-22.txt (text/plain, attachment)]
[aptitude-segfault-2016-01-22.txt (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Fri, 22 Jan 2016 09:03:03 GMT) (full text, mbox, link).


Acknowledgement sent to Julian Andres Klode <jak@debian.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Fri, 22 Jan 2016 09:03:04 GMT) (full text, mbox, link).


Message #10 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Julian Andres Klode <jak@debian.org>
To: Sven Hartge <sven@svenhartge.de>, 812251@bugs.debian.org
Subject: Re: Bug#812251: apt: suddenly segfaults after "apt update"
Date: Fri, 22 Jan 2016 09:59:18 +0100
On 22 January 2016 at 00:31, Sven Hartge <sven@svenhartge.de> wrote:
> Package: apt
> Version: 1.2
> Severity: important
>
> Hi!
>
> This is Debian Sid on a Cubietruck.
>
> Today, suddenly, apt, apt-get and aptitude all segfault after the recent
> update to the package lists.
>
>  "apt update" works but segfaults at the end during "Reading package lists ..."
>
>  "apt-get update" the same (unsurprising)
>
>  "aptitude update" segfaults immediately (after running a bit, but
>  before downloading anything)
>
>  "gdb aptitude update" on the other hand segfaults after downloading
>  something. (Weird. Heisebug?)
>
> I am attaching backtraces for both apt and aptitude.
>
> (If you need the contents of /var/lib/apt* and /var/lib/dpkg/status I
> can make those available via seperate download.
>

Thanks. It seems that your cache is being remapped, and the version
stringview we generated by passing Ver.VerStr() to NewProvides()
becomes invalid in that call. Previously, this was a string, copying
the memory instead.

There are potentially two ways to solve this: Allow the cache
generator to remap string views where needed or revert affected parts
back to strings. Obviously, strings have some performance overhead,
especially on arm, which is why I replaced them with views in the
first place.

In the meantime, you can workaround the issue by setting
APT::Cache-Start to a large value.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.



Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Fri, 22 Jan 2016 12:12:07 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Hartge <sven@svenhartge.de>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Fri, 22 Jan 2016 12:12:07 GMT) (full text, mbox, link).


Message #15 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Sven Hartge <sven@svenhartge.de>
To: Julian Andres Klode <jak@debian.org>, 812251@bugs.debian.org
Subject: Re: Bug#812251: apt: suddenly segfaults after "apt update"
Date: Fri, 22 Jan 2016 13:10:47 +0100
[Message part 1 (text/plain, inline)]
On 22.01.2016 09:59, Julian Andres Klode wrote:

> In the meantime, you can workaround the issue by setting
> APT::Cache-Start to a large value.

Just confirming, setting APT::Cache-Start "100000000"; works around the
problem and apt works again with my sources.list.

Grüße,
Sven.


[signature.asc (application/pgp-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Sat, 23 Jan 2016 13:51:07 GMT) (full text, mbox, link).


Acknowledgement sent to Julian Andres Klode <jak@debian.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sat, 23 Jan 2016 13:51:07 GMT) (full text, mbox, link).


Message #20 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Julian Andres Klode <jak@debian.org>
To: Sven Hartge <sven@svenhartge.de>, 812251@bugs.debian.org
Subject: Re: Bug#812251: apt: suddenly segfaults after "apt update"
Date: Sat, 23 Jan 2016 14:49:42 +0100
On 22 January 2016 at 09:59, Julian Andres Klode <jak@debian.org> wrote:
> On 22 January 2016 at 00:31, Sven Hartge <sven@svenhartge.de> wrote:
>> Package: apt
>> Version: 1.2
>> Severity: important
>>
>> Hi!
>>
>> This is Debian Sid on a Cubietruck.
>>
>> Today, suddenly, apt, apt-get and aptitude all segfault after the recent
>> update to the package lists.
>>
>>  "apt update" works but segfaults at the end during "Reading package lists ..."
>>
>>  "apt-get update" the same (unsurprising)
>>
>>  "aptitude update" segfaults immediately (after running a bit, but
>>  before downloading anything)
>>
>>  "gdb aptitude update" on the other hand segfaults after downloading
>>  something. (Weird. Heisebug?)
>>
>> I am attaching backtraces for both apt and aptitude.
>>
>> (If you need the contents of /var/lib/apt* and /var/lib/dpkg/status I
>> can make those available via seperate download.
>>
>
> Thanks. It seems that your cache is being remapped, and the version
> stringview we generated by passing Ver.VerStr() to NewProvides()
> becomes invalid in that call. Previously, this was a string, copying
> the memory instead.
>
> There are potentially two ways to solve this: Allow the cache
> generator to remap string views where needed or revert affected parts
> back to strings. Obviously, strings have some performance overhead,
> especially on arm, which is why I replaced them with views in the
> first place.
>

The branch

  https://github.com/julian-klode/apt bugfix/remap-stringview

should fix the issue. Comparison to 1.2 is at:

  https://github.com/julian-klode/apt/compare/master...julian-klode:bugfix/remap-stringview

I cannot reproduce the issue locally though, so I might have missed
something. If you still can, it would be great if you could build
libapt-pkg5.0 from that and see if you can reproduce it or if it works
now.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.



Message sent on to Sven Hartge <sven@svenhartge.de>:
Bug#812251. (Sat, 23 Jan 2016 14:27:03 GMT) (full text, mbox, link).


Message #23 received at 812251-submitter@bugs.debian.org (full text, mbox, reply):

From: Julian Andres Klode <jak@debian.org>
To: 812251-submitter@bugs.debian.org
Subject: Bug#812251 in apt marked as pending
Date: Sat, 23 Jan 2016 14:23:57 +0000
Control: tag 812251 pending

Hello,

Bug #812251 in apt reported by you has been fixed in the Git repository. You can
see the commit message below, and you can check the diff of the fix at:

    https://anonscm.debian.org/cgit/apt/apt.git/diff/?id=7dd0c2e

(this message was generated automatically based on the git commit message)
---
commit 7dd0c2eb45874d3df9a9ee2034501659548a1b97
Author: Julian Andres Klode <jak@debian.org>
Date:   Sat Jan 23 13:15:31 2016 +0100

    Remap StringView instances pointing into the cache
    
    It turns out that StringViews might need to be remapped in some
    places because they come from the cache. For example, some sites
    pass a Ver.VerStr() to NewProvides().
    
    Such a StringView would become invalid during the duration of
    the call if the cache is remapped, causing the program to die
    with a segmentation fault.
    
    We can take care of those issues by remapping string views in
    the same way we remap all the iterators. String views are only
    remapped if they point into the cache though, this allows us
    to write more generic code on the callee site without having
    to check whether the view points into the cache or not.
    That's not as efficient as possible, but the overhead does not
    appear to be measurable.
    
    Closes: #812251



Added tag(s) pending. Request was from Julian Andres Klode <jak@debian.org> to 812251-submitter@bugs.debian.org. (Sat, 23 Jan 2016 14:27:03 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Sat, 23 Jan 2016 23:36:19 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Hartge <sven@svenhartge.de>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sat, 23 Jan 2016 23:36:20 GMT) (full text, mbox, link).


Message #30 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Sven Hartge <sven@svenhartge.de>
To: Julian Andres Klode <jak@debian.org>
Cc: 812251@bugs.debian.org
Subject: Re: Bug#812251: apt: suddenly segfaults after "apt update"
Date: Sun, 24 Jan 2016 00:33:30 +0100 (CET)
Um 14:49 Uhr am 23.01.16 schrieb Julian Andres Klode:

> 
>   https://github.com/julian-klode/apt/compare/master...julian-klode:bugfix/remap-stringview
> 
> I cannot reproduce the issue locally though, so I might have missed
> something. If you still can, it would be great if you could build
> libapt-pkg5.0 from that and see if you can reproduce it or if it works
> now.

I got the diff from git https://anonscm.debian.org/cgit/apt/apt.git/diff/?id=7dd0c2e 
and tried to build apt in a Sid chroot with cowbuilder, but the build fails with the
following messages:

Compiling pkgcachegen.cc to ../build/obj/apt-pkg/pkgcachegen.opic
g++ -c -MD -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -D_REENTRANT -D_FORTIFY_SOURCE=2 -I../build/include -DAPT_DOMAIN='"libapt-pkg5.0"' -std=c++11 -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-include-dirs -Wnoexcept -Wsign-promo -Wundef -DAPT_PKG_EXPOSE_STRING_VIEW -fPIC -DPIC -o ../build/obj/apt-pkg/pkgcachegen.opic '/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc'
In file included from ../build/include/apt-pkg/pkgcachegen.h:23:0,
                 from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
../build/include/apt-pkg/pkgcache.h: In member function 'APT::StringView pkgCache::ViewString(map_stringitem_t) const':
../build/include/apt-pkg/pkgcache.h:252:80: warning: cast from 'char*' to 'const uint16_t* {aka const short unsigned int*}' increases required alignment of target type [-Wcast-align]
       uint16_t len = *reinterpret_cast<const uint16_t*>(name - sizeof(uint16_t));
                                                                                ^
/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc: In member function 'void pkgCacheGenerator::ReMap(const void*, const void*)':
/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:183:57: error: 'oldSize' was not declared in this scope
   || ViewP->data() > static_cast<const char*>(oldMap) + oldSize)
                                                         ^
In file included from ../build/include/apt-pkg/strutl.h:31:0,
                 from ../build/include/apt-pkg/hashsum_template.h:20,
                 from ../build/include/apt-pkg/md5.h:28,
                 from ../build/include/apt-pkg/pkgcachegen.h:21,
                 from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc: In member function 'bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator&, APT::StringView, APT::StringView)':
/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:563:31: warning: 'pkgCache::Package::Name' is deprecated: Use the .Name() method instead of accessing the member directly [-Wdeprecated-declarations]
    APT_IGNORE_DEPRECATED(Pkg->Name = Grp->Name;)
                               ^
../build/include/apt-pkg/macros.h:147:3: note: in definition of macro 'APT_IGNORE_DEPRECATED'
   XXX \
   ^
In file included from ../build/include/apt-pkg/pkgcachegen.h:23:0,
                 from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
../build/include/apt-pkg/pkgcache.h:443:107: note: declared here
    APT_DEPRECATED_MSG("Use the .Name() method instead of accessing the member directly") map_stringitem_t Name;
                                                                                                           ^
In file included from ../build/include/apt-pkg/strutl.h:31:0,
                 from ../build/include/apt-pkg/hashsum_template.h:20,
                 from ../build/include/apt-pkg/md5.h:28,
                 from ../build/include/apt-pkg/pkgcachegen.h:21,
                 from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:563:31: warning: 'pkgCache::Package::Name' is deprecated: Use the .Name() method instead of accessing the member directly [-Wdeprecated-declarations]
    APT_IGNORE_DEPRECATED(Pkg->Name = Grp->Name;)
                               ^../build/include/apt-pkg/macros.h:147:3: note: in definition of macro 'APT_IGNORE_DEPRECATED'
   XXX \
   ^
In file included from ../build/include/apt-pkg/pkgcachegen.h:23:0,
                 from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
../build/include/apt-pkg/pkgcache.h:443:107: note: declared here
    APT_DEPRECATED_MSG("Use the .Name() method instead of accessing the member directly") map_stringitem_t Name;
                                                                                                           ^
In file included from ../build/include/apt-pkg/strutl.h:31:0,
                 from ../build/include/apt-pkg/hashsum_template.h:20,
                 from ../build/include/apt-pkg/md5.h:28,
                 from ../build/include/apt-pkg/pkgcachegen.h:21,
                 from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:563:31: warning: 'pkgCache::Package::Name' is deprecated: Use the .Name() method instead of accessing the member directly [-Wdeprecated-declarations]
    APT_IGNORE_DEPRECATED(Pkg->Name = Grp->Name;)
                               ^
../build/include/apt-pkg/macros.h:147:3: note: in definition of macro 'APT_IGNORE_DEPRECATED'
   XXX \
   ^
In file included from ../build/include/apt-pkg/pkgcachegen.h:23:0,
                 from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
../build/include/apt-pkg/pkgcache.h:443:107: note: declared here
    APT_DEPRECATED_MSG("Use the .Name() method instead of accessing the member directly") map_stringitem_t Name;
                                                                                                           ^
../buildlib/library.mak:69: recipe for target '../build/obj/apt-pkg/pkgcachegen.opic' failed
make[2]: *** [../build/obj/apt-pkg/pkgcachegen.opic] Error 1
make[2]: Leaving directory '/build/apt-1.2.0~sh.1/apt-pkg'
Makefile:14: recipe for target 'binary' failed
make[1]: *** [binary] Error 2
make[1]: Leaving directory '/build/apt-1.2.0~sh.1'
debian/rules:103: recipe for target 'build/build-binary-stamp' failed
make: *** [build/build-binary-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Grüße,
Sven.



Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Sat, 23 Jan 2016 23:42:26 GMT) (full text, mbox, link).


Acknowledgement sent to Julian Andres Klode <jak@debian.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sat, 23 Jan 2016 23:42:26 GMT) (full text, mbox, link).


Message #35 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Julian Andres Klode <jak@debian.org>
To: Sven Hartge <sven@svenhartge.de>
Cc: 812251@bugs.debian.org
Subject: Re: Bug#812251: apt: suddenly segfaults after "apt update"
Date: Sun, 24 Jan 2016 00:40:25 +0100
On Sun, Jan 24, 2016 at 12:33:30AM +0100, Sven Hartge wrote:
> Um 14:49 Uhr am 23.01.16 schrieb Julian Andres Klode:
> 
> > 
> >   https://github.com/julian-klode/apt/compare/master...julian-klode:bugfix/remap-stringview
> > 
> > I cannot reproduce the issue locally though, so I might have missed
> > something. If you still can, it would be great if you could build
> > libapt-pkg5.0 from that and see if you can reproduce it or if it works
> > now.
> 
> I got the diff from git https://anonscm.debian.org/cgit/apt/apt.git/diff/?id=7dd0c2e 
> and tried to build apt in a Sid chroot with cowbuilder, but the build fails with the
> following messages:
> 
> Compiling pkgcachegen.cc to ../build/obj/apt-pkg/pkgcachegen.opic
> g++ -c -MD -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -D_REENTRANT -D_FORTIFY_SOURCE=2 -I../build/include -DAPT_DOMAIN='"libapt-pkg5.0"' -std=c++11 -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wextra -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-include-dirs -Wnoexcept -Wsign-promo -Wundef -DAPT_PKG_EXPOSE_STRING_VIEW -fPIC -DPIC -o ../build/obj/apt-pkg/pkgcachegen.opic '/build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc'
> In file included from ../build/include/apt-pkg/pkgcachegen.h:23:0,
>                  from /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:15:
> ../build/include/apt-pkg/pkgcache.h: In member function 'APT::StringView pkgCache::ViewString(map_stringitem_t) const':
> ../build/include/apt-pkg/pkgcache.h:252:80: warning: cast from 'char*' to 'const uint16_t* {aka const short unsigned int*}' increases required alignment of target type [-Wcast-align]
>        uint16_t len = *reinterpret_cast<const uint16_t*>(name - sizeof(uint16_t));
>                                                                                 ^
> /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc: In member function 'void pkgCacheGenerator::ReMap(const void*, const void*)':
> /build/apt-1.2.0~sh.1/apt-pkg/pkgcachegen.cc:183:57: error: 'oldSize' was not declared in this scope
>    || ViewP->data() > static_cast<const char*>(oldMap) + oldSize)

Yes, that's to be expected. I introduced this in the commit before. Gotta
keep those commits logically separated :)

https://anonscm.debian.org/cgit/apt/apt.git/commit/?id=19819ac58a420275e0ae9aa7e2a34c72cba8af5e



-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to (`inline'). Thank you.



Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Sun, 24 Jan 2016 01:36:03 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Hartge <sven@svenhartge.de>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sun, 24 Jan 2016 01:36:03 GMT) (full text, mbox, link).


Message #40 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Sven Hartge <sven@svenhartge.de>
To: Julian Andres Klode <jak@debian.org>
Cc: 812251@bugs.debian.org
Subject: Re: Bug#812251: apt: suddenly segfaults after "apt update"
Date: Sun, 24 Jan 2016 02:32:03 +0100 (CET)
Um 14:49 Uhr am 23.01.16 schrieb Julian Andres Klode:

> I cannot reproduce the issue locally though, so I might have missed 
> something. If you still can, it would be great if you could build 
> libapt-pkg5.0 from that and see if you can reproduce it or if it works 
> now.

Well, problem is: I cannot reproduce this anymore either. Todays package 
lists do not invoke the segfault anymore. There must have been something 
"magical" about the files from the day I submitted the bug report.

But the good news is that the patched version does not misbehave either, 
as far as I can see.

Grüße,
Sven.



Reply sent to Julian Andres Klode <jak@debian.org>:
You have taken responsibility. (Mon, 25 Jan 2016 17:21:23 GMT) (full text, mbox, link).


Notification sent to Sven Hartge <sven@svenhartge.de>:
Bug acknowledged by developer. (Mon, 25 Jan 2016 17:21:23 GMT) (full text, mbox, link).


Message #45 received at 812251-close@bugs.debian.org (full text, mbox, reply):

From: Julian Andres Klode <jak@debian.org>
To: 812251-close@bugs.debian.org
Subject: Bug#812251: fixed in apt 1.2.1
Date: Mon, 25 Jan 2016 17:18:48 +0000
Source: apt
Source-Version: 1.2.1

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 812251@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Andres Klode <jak@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 25 Jan 2016 18:03:50 +0100
Source: apt
Binary: apt libapt-pkg5.0 libapt-inst2.0 apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source
Version: 1.2.1
Distribution: unstable
Urgency: high
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Julian Andres Klode <jak@debian.org>
Description:
 apt        - commandline package manager
 apt-doc    - documentation for APT
 apt-transport-https - https download transport for APT
 apt-utils  - package management related utility programs
 libapt-inst2.0 - deb package format runtime library
 libapt-pkg-dev - development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - documentation for APT development
 libapt-pkg5.0 - package management runtime library
Closes: 812251
Changes:
 apt (1.2.1) unstable; urgency=high
 .
   [ Zhou Mo ]
   * po: update zh_CN programs translation
 .
   [ Julian Andres Klode ]
   * Remap StringView instances pointing into the cache (Closes: #812251)
 .
   [ Michael Vogt ]
   * Log calling SUDO_USER or PKEXEC_UID in history.log.
     Thanks to Thomas Reusch
Checksums-Sha1:
 5da28759764e29fa3a0c67c6e59637d8bc2b6b82 2339 apt_1.2.1.dsc
 12a6937f41471ff4434264a7a27248a082cc7e95 2015884 apt_1.2.1.tar.xz
Checksums-Sha256:
 7c04b4ba3911444f136bfd99bb856c360cf1625ab3d50e6aaa885fd37b56beb7 2339 apt_1.2.1.dsc
 909dab628a027c8adb7cbc9ce8cbc92794cb90e472d652aa540fe928d932fa9d 2015884 apt_1.2.1.tar.xz
Files:
 fc06e708d30dcaaa68673eabfcd9786c 2339 admin important apt_1.2.1.dsc
 e941c5272c5ed298950baae39ea06176 2015884 admin important apt_1.2.1.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJWplZrAAoJENc8OeVlgLOGpYkP/0I8rNJuSS0kT+SUdqMcZL3B
jemh+om1btxDYygtHFo9wmOxK7eE8onqobKE3CHNwX3YcH62LT0uQjPvK4dgfAM6
3h43MetT3FXrh+kfmP7ouoQLxDDmHBlXJ4jDiNQI4VEdxb85WaQIW1cXHMfSkic0
SU8OLMy2ESuAPEjd8kA5AfxCPJP7IbkAcyM3TozALlfXomx252s+r5kPNeLyR6je
vStSTvw0n/XlQe6dW9j524E6Htif5KI3p1oJmJEMasLHKRhKIS6m/EwKNwDRbc5I
qlUKoRavbtvFCyP3oweXNpiiRIa7L2avneydYdm6ifMaL9BQ/QqK6Y/U6hTV3yr7
eiSJW1fq5rnIr8OZMC26lfIgen3sRGD+kgNmsmU54lGI96WBkSUoma3e4ohQNOrF
h7HSUoI2AA8icul89HzBmNC0OYPl1tJbYfwSiGimsxNt3v6BA2/nKPxuegx7Z7/j
PkHbSoDoESw4tp1Hh31RYJgkklmtzoMC7/khNHo5hi4+ka77v2xec1GcrV8pJm4z
MX58q4dBWKFffqbvfqbYa8wCJmB4M9+4B/ZocsZKh0GgTagvnAFLRuRskXKEJLia
qywQfwFeTvAEwiLcIt5rR3Kk4Acum5oTmCLcu+yoo3CYiEjrHsv313OZ82TsMndc
ZQfPFP0o0vf723dr5tMd
=xtFU
-----END PGP SIGNATURE-----




Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Sun, 21 Feb 2016 11:39:04 GMT) (full text, mbox, link).


Acknowledgement sent to Francesco Poli <invernomuto@paranoici.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sun, 21 Feb 2016 11:39:04 GMT) (full text, mbox, link).


Message #50 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Francesco Poli <invernomuto@paranoici.org>
To: Julian Andres Klode <jak@debian.org>
Cc: 812251@bugs.debian.org
Subject: Re: Bug#812251: fixed in apt 1.2.1
Date: Sun, 21 Feb 2016 12:34:03 +0100
[Message part 1 (text/plain, inline)]
Control: found -1 apt/1.2.3


On Mon, 25 Jan 2016 17:18:48 +0000 Julian Andres Klode wrote:

> Source: apt
> Source-Version: 1.2.1
> 
> We believe that the bug you reported is fixed in the latest version of
> apt, which is due to be installed in the Debian FTP archive.
[...]
>    * Remap StringView instances pointing into the cache (Closes: #812251)
[...]

Hello,
I've just experienced this issue (for the first time) with apt/1.2.3 on
a i386 Debian testing box (a Soekris net5501-60 board, to be precise).

Today, running:

  # aptitude update
  Get: 1 http://security.debian.org testing/updates InRelease [62.8 kB]
  [...]
  Get: 21 http://debian.ethz.ch/debian unstable/main Translation-en 2016-02-21-0858.48.pdiff [97 B]
  Fetched 868 kB in 1min 19s (11.0 kB/s)
  [100%] Reading package listsSegmentation fault

led to a segfault.
Trying again was useless:

  # aptitude update
  Segmentation fault

Wiping /var/lib/apt/lists completely and starting afresh was useless:

  # aptitude update
  Get: 1 http://security.debian.org testing/updates InRelease [62.8 kB]
  [...]
  Get: 9 http://debian.ethz.ch/debian unstable/main Translation-en [5,319 kB]     
  Fetched 26.7 MB in 2min 41s (165 kB/s)                                          
  [100%] Reading package listsSegmentation fault

Updating the package lists with apt equally resulted in a segfault:

  # apt update 
  Hit:1 http://security.debian.org testing/updates InRelease
  Hit:2 http://debmirror.amis.net/debian testing InRelease
  Hit:3 http://debmirror.amis.net/debian unstable InRelease
  Segmentation faultsts... 65%

Using the workaround suggested in this bug log (see message #15)
allowed me to update the package lists:

  # aptitude -o APT::Cache-Start=100000000 update 
  Hit http://security.debian.org testing/updates InRelease
  Hit http://ftp-stud.hs-esslingen.de/debian unstable InRelease
  Hit http://debmirror.amis.net/debian testing InRelease

without any segfaults.
After that, everything worked fine:

  # aptitude --purge-unused safe-upgrade
  The following packages will be upgraded:
  [...]
  Current status: 0 (-3) upgradable.


Please note that I had libapt-pkg5.0/1.2.3 installed on this box, both
before and after today's upgrade.

I am reopening the bug report, since the bug does not seem to be
(completely) fixed.
Please fix this issue.

Thanks for your time!
Bye.

-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
[Message part 2 (application/pgp-signature, inline)]

Marked as found in versions apt/1.2.3 and reopened. Request was from Francesco Poli <invernomuto@paranoici.org> to 812251-submit@bugs.debian.org. (Sun, 21 Feb 2016 11:39:04 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Sun, 21 Feb 2016 22:15:09 GMT) (full text, mbox, link).


Acknowledgement sent to David Kalnischkies <david@kalnischkies.de>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sun, 21 Feb 2016 22:15:09 GMT) (full text, mbox, link).


Message #57 received at 812251@bugs.debian.org (full text, mbox, reply):

From: David Kalnischkies <david@kalnischkies.de>
To: Francesco Poli <invernomuto@paranoici.org>, 812251@bugs.debian.org
Subject: Re: Bug#812251: fixed in apt 1.2.1
Date: Sun, 21 Feb 2016 23:11:57 +0100
[Message part 1 (text/plain, inline)]
On Sun, Feb 21, 2016 at 12:34:03PM +0100, Francesco Poli wrote:
> led to a segfault.
> Trying again was useless:
> 
>   # aptitude update
>   Segmentation fault

No suprise here: apt, apt-get, aptitude, packagekit, … all use the same
code internally shared via libapt so if one segfaults in update all
others will, too.


> Wiping /var/lib/apt/lists completely and starting afresh was useless:

Zip up the lists/ directory + your /etc/apt. DO NOT run update again
before doing that. Upload that somewhere. Also/Alternatively run
$ grep ^Date /var/lib/apt/lists/*Release
That way we should be able to get the needed files from snapshot.d.o
(assuming you haven't third-party sources enabled).

The "fun" part about these cache generation segfaults is that they are
highly dependent on pretty much everything and the slightest change to
the files (and possibly also the moon) will not trigger them again as
the 'buggy' code behaves normal in 99,99% of all cases.

Having the files available might or might not help in figuring out the
problem, but it at least helps consistently in figuring out if the
specific instance is really found and fixed.

You could also install debug packages (copy back the buggy lists/
directory after that) and provide a stacktrace.


Best regards

David Kalnischkies
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Sun, 21 Feb 2016 23:24:08 GMT) (full text, mbox, link).


Acknowledgement sent to Francesco Poli <invernomuto@paranoici.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sun, 21 Feb 2016 23:24:08 GMT) (full text, mbox, link).


Message #62 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Francesco Poli <invernomuto@paranoici.org>
To: David Kalnischkies <david@kalnischkies.de>
Cc: 812251@bugs.debian.org
Subject: Re: Bug#812251: fixed in apt 1.2.1
Date: Mon, 22 Feb 2016 00:12:28 +0100
[Message part 1 (text/plain, inline)]
On Sun, 21 Feb 2016 23:11:57 +0100 David Kalnischkies wrote:

> On Sun, Feb 21, 2016 at 12:34:03PM +0100, Francesco Poli wrote:
[...]
> > Wiping /var/lib/apt/lists completely and starting afresh was useless:
> 
> Zip up the lists/ directory + your /etc/apt. DO NOT run update again
> before doing that. Upload that somewhere. Also/Alternatively run
> $ grep ^Date /var/lib/apt/lists/*Release

Hello David!
The output of this command is:

  # grep ^Date *Release
  httpredir.debian.org_debian_dists_testing_InRelease:Date: Sun, 21 Feb 2016 09:20:23 UTC
  httpredir.debian.org_debian_dists_unstable_InRelease:Date: Sun, 21 Feb 2016 09:20:23 UTC
  security.debian.org_dists_testing_updates_InRelease:Date: Sat, 20 Feb 2016 16:10:41 UTC

> That way we should be able to get the needed files from snapshot.d.o
> (assuming you haven't third-party sources enabled).

No third-party sources enabled, hence everything should be obtainable
from snapshot.d.o ...

> 
> The "fun" part about these cache generation segfaults is that they are
> highly dependent on pretty much everything and the slightest change to
> the files (and possibly also the moon) will not trigger them again as
> the 'buggy' code behaves normal in 99,99% of all cases.
> 
> Having the files available might or might not help in figuring out the
> problem, but it at least helps consistently in figuring out if the
> specific instance is really found and fixed.

I'll see what I can do to make the files available.


-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Mon, 22 Feb 2016 14:24:03 GMT) (full text, mbox, link).


Acknowledgement sent to Marc Haber <mh+debian-bugs@zugschlus.de>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Mon, 22 Feb 2016 14:24:03 GMT) (full text, mbox, link).


Message #67 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Marc Haber <mh+debian-bugs@zugschlus.de>
To: David Kalnischkies <david@kalnischkies.de>, Francesco Poli <invernomuto@paranoici.org>, 812251@bugs.debian.org, 812251-submitter@bugs.debian.org
Subject: Re: Bug#812251: fixed in apt 1.2.1
Date: Mon, 22 Feb 2016 15:21:14 +0100
Hi David,

On Sun, Feb 21, 2016 at 11:11:57PM +0100, David Kalnischkies wrote:
> Zip up the lists/ directory + your /etc/apt. DO NOT run update again
> before doing that. Upload that somewhere.

http://q.bofh.de/~mh/stuff/apt-data-812251.tar.xz (42MB)

Hope this helps. Please tell me when I can remove the download

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Message sent on to Sven Hartge <sven@svenhartge.de>:
Bug#812251. (Mon, 22 Feb 2016 14:24:29 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Mon, 22 Feb 2016 20:27:08 GMT) (full text, mbox, link).


Acknowledgement sent to David Kalnischkies <david@kalnischkies.de>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Mon, 22 Feb 2016 20:27:08 GMT) (full text, mbox, link).


Message #75 received at 812251@bugs.debian.org (full text, mbox, reply):

From: David Kalnischkies <david@kalnischkies.de>
To: Marc Haber <mh+debian-bugs@zugschlus.de>
Cc: Francesco Poli <invernomuto@paranoici.org>, 812251@bugs.debian.org
Subject: Re: Bug#812251: fixed in apt 1.2.1
Date: Mon, 22 Feb 2016 21:24:04 +0100
[Message part 1 (text/plain, inline)]
On Mon, Feb 22, 2016 at 03:21:14PM +0100, Marc Haber wrote:
> On Sun, Feb 21, 2016 at 11:11:57PM +0100, David Kalnischkies wrote:
> > Zip up the lists/ directory + your /etc/apt. DO NOT run update again
> > before doing that. Upload that somewhere.
> 
> http://q.bofh.de/~mh/stuff/apt-data-812251.tar.xz (42MB)
> 
> Hope this helps. Please tell me when I can remove the download

Thanks (also to Francesco who uploaded the files privately).

Unfortunately I can't reproduce it with either at the moment, which is
a bit strange at the very least in Francesco's case as his output
suggests a segfault at 65% done, which should be still inside the lists/
files and not in the dpkg/status file as the later is very small
compared to (multiple) Packages+Translation files. Mhhhhh.

I drop my binary caches just to be sure
# rm /var/cache/apt/*.bin
and then I am trying as user with
$ apt-cache policy -o dir::etc=/tmp/poli/etc -o dir::state::lists=/tmp/poli/lists -o apt::architecture=i386
and
$ apt-cache policy -o dir::etc=/tmp/haber/etc/apt -o dir::state::lists=/tmp/haber/var/lib/apt/lists
respectively.

That should be segfaulting as any apt command is building a binary cache
(if need be in memory only), but it doesn't for me. I presume it does
for you guys…


(Not a hell of a lot of time at the moment, so if someone else feels
like working on it I wouldn't complain)


Best regards

David Kalnischkies
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#812251; Package apt. (Mon, 22 Feb 2016 21:27:08 GMT) (full text, mbox, link).


Acknowledgement sent to Francesco Poli <invernomuto@paranoici.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Mon, 22 Feb 2016 21:27:08 GMT) (full text, mbox, link).


Message #80 received at 812251@bugs.debian.org (full text, mbox, reply):

From: Francesco Poli <invernomuto@paranoici.org>
To: David Kalnischkies <david@kalnischkies.de>
Cc: Marc Haber <mh+debian-bugs@zugschlus.de>, 812251@bugs.debian.org
Subject: Re: Bug#812251: fixed in apt 1.2.1
Date: Mon, 22 Feb 2016 22:09:00 +0100
[Message part 1 (text/plain, inline)]
On Mon, 22 Feb 2016 21:24:04 +0100 David Kalnischkies wrote:

> On Mon, Feb 22, 2016 at 03:21:14PM +0100, Marc Haber wrote:
> > On Sun, Feb 21, 2016 at 11:11:57PM +0100, David Kalnischkies wrote:
> > > Zip up the lists/ directory + your /etc/apt. DO NOT run update again
> > > before doing that. Upload that somewhere.
> > 
> > http://q.bofh.de/~mh/stuff/apt-data-812251.tar.xz (42MB)
> > 
> > Hope this helps. Please tell me when I can remove the download
> 
> Thanks (also to Francesco who uploaded the files privately).

You're welcome!

> 
> Unfortunately I can't reproduce it with either at the moment, which is
> a bit strange at the very least in Francesco's case as his output
> suggests a segfault at 65% done, which should be still inside the lists/
> files and not in the dpkg/status file as the later is very small
> compared to (multiple) Packages+Translation files. Mhhhhh.
> 
> I drop my binary caches just to be sure
> # rm /var/cache/apt/*.bin
> and then I am trying as user with
> $ apt-cache policy -o dir::etc=/tmp/poli/etc -o dir::state::lists=/tmp/poli/lists -o apt::architecture=i386
> 
[...]
> That should be segfaulting as any apt command is building a binary cache
> (if need be in memory only), but it doesn't for me. I presume it does
> for you guys…

The above commands lead to a segfault on my i386 Debian testing box
(Soekris net5501-60 board), but not on an amd64 box.

Have you tried to reproduce the bug on an i386 (real hardware or
virtual) machine?



-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
[Message part 2 (application/pgp-signature, inline)]

Message sent on to Sven Hartge <sven@svenhartge.de>:
Bug#812251. (Sun, 06 Mar 2016 14:09:11 GMT) (full text, mbox, link).


Message #83 received at 812251-submitter@bugs.debian.org (full text, mbox, reply):

From: David Kalnischkies <david@kalnischkies.de>
To: 812251-submitter@bugs.debian.org
Subject: Bug#812251 in apt marked as pending
Date: Sun, 06 Mar 2016 14:07:06 +0000
Control: tag 812251 pending

Hello,

Bug #812251 in apt reported by you has been fixed in the Git repository. You can
see the commit message below, and you can check the diff of the fix at:

    https://anonscm.debian.org/cgit/apt/apt.git/diff/?id=06a8e0d

(this message was generated automatically based on the git commit message)
---
commit 06a8e0dcb37796136be983b247c5d1bbfdf47a2e
Author: David Kalnischkies <kalnischkies@gmail.com>
Date:   Sun Mar 6 14:44:06 2016 +0100

    get group again after potential remap in Source: parse
    
    Mysteriously segfaults only on i386 for me, but at least one reporter
    had the same behavior and it makes sense that this is the problem as the
    parsing of Source: was fixed in 1.2.2 – before the not remapped group
    was not used.
    
    We don't use our usual Dynamic<> trick here as we don't have it in the
    parser. Its a bit of a layer violation to do this parsing here, but its
    how it is always was…
    
    Until next time with this lovely kind of problem.
    
    Closes: 812251
    Thanks: Francesco Poli and Marc Haber for testdata.



Added tag(s) pending. Request was from David Kalnischkies <david@kalnischkies.de> to 812251-submitter@bugs.debian.org. (Sun, 06 Mar 2016 14:09:11 GMT) (full text, mbox, link).


Reply sent to Julian Andres Klode <jak@debian.org>:
You have taken responsibility. (Sun, 06 Mar 2016 19:21:12 GMT) (full text, mbox, link).


Notification sent to Sven Hartge <sven@svenhartge.de>:
Bug acknowledged by developer. (Sun, 06 Mar 2016 19:21:13 GMT) (full text, mbox, link).


Message #90 received at 812251-close@bugs.debian.org (full text, mbox, reply):

From: Julian Andres Klode <jak@debian.org>
To: 812251-close@bugs.debian.org
Subject: Bug#812251: fixed in apt 1.2.5
Date: Sun, 06 Mar 2016 19:19:24 +0000
Source: apt
Source-Version: 1.2.5

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 812251@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Andres Klode <jak@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 06 Mar 2016 19:47:45 +0100
Source: apt
Binary: apt libapt-pkg5.0 libapt-inst2.0 apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source
Version: 1.2.5
Distribution: unstable
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Julian Andres Klode <jak@debian.org>
Description:
 apt        - commandline package manager
 apt-doc    - documentation for APT
 apt-transport-https - https download transport for APT
 apt-utils  - package management related utility programs
 libapt-inst2.0 - deb package format runtime library
 libapt-pkg-dev - development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - documentation for APT development
 libapt-pkg5.0 - package management runtime library
Closes: 751688 812251 816691 816837
Changes:
 apt (1.2.5) unstable; urgency=medium
 .
   [ Daniel Kahn Gillmor ]
   * apt-key del should correctly handle keyids prefixed with 0x
 .
   [ David Kalnischkies ]
   * support APT::Get::Build-Dep-Automatic again in build-dep
   * add test for apt-key 0xKEY and use parameter expansion.
     Thanks to James McCoy for the suggestion. (Closes: 816691)
   * do not move not-failed pdiff-patches into CWD on failure (Closes: #816837)
   * get group again after potential remap in Source: parse.
     Thanks to Francesco Poli and Marc Haber for testdata. (Closes: 812251)
 .
   [ Colin Watson ]
   * Fix lzma write support to handle "try again" case (Closes: #751688)
 .
   [ Julian Andres Klode ]
   * Prevent double remapping of iterators and string views
   * debian/control: Set Standards-Version to 3.9.7
Checksums-Sha1:
 e1f0f2899572173dac6a1b905538654f3ec84380 2323 apt_1.2.5.dsc
 39bea5b453fb53eaf54e9e86ae6f1a838d4c2e2f 2021276 apt_1.2.5.tar.xz
Checksums-Sha256:
 555b532ea99b760fecc53a87b5060f2a0c356c9de5f0b9de42a806e0f622882d 2323 apt_1.2.5.dsc
 cc61eeeb32309d295f6348ba5e9c37bc54d5af7cdd1fa9e75abfbbd9c4c827b6 2021276 apt_1.2.5.tar.xz
Files:
 b68e6b93fa2f4f40f903c70ab4e2b608 2323 admin important apt_1.2.5.dsc
 19ee3d6c146c57e16a31f802540d1bf0 2021276 admin important apt_1.2.5.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJW3HvqAAoJENc8OeVlgLOGkPAP/2J8lMPhXtZGvqcd9GFEOzQt
h24zDcCkKu0tZ0XmMhSAvEMIL3V88fKfEA1Gf2TJm3rDwyBKio5FLAheP/+b+apa
xNPCQE6TuRvsyemyeGkN0eE6JPsGy72+RA+Ut3/hg104/grKPcW3ejc8uFuKxHl5
aBoNkDCKCoUe7pnP9iwJUzytj9od2gqzSjWJFoJr4OumhtSXZzqoGwuWckKp349J
wxnQrj4ODAhaX+vLn0n01BsFNwgb34q1v4TXtRDd3wtpX6s4ZwZM1VBLP2C6mYNw
3mMy8fkLvUcOqW1wlgvKDk4E5+t1KRzTGFfVkDIrkMK8J6vypOXz3LQ1KVplNB9Q
YrDViUDxeOzGor/1ZT9TD+kUDAI4ynTIWHV29UROiEOX9JJu1K5A/ZnnINN70OdF
H5yZSFA4lv6EYYvXYpdGkSHj2xVSyBBamAOtUV+H+E88u9mbT1TeLb1uqCNNoTdo
aJ966xzYuKKXPrT3h07EiQzh6jJ5/ih6OXgVE3w1tB0fA06hoNiwtnUcD1w3AU0Q
akHYIVgJn8eGlxbjswh2hBwL1OxxsBMMSiykZvOAGZacZfXbk7iBqb3C4WEztLRl
7RJ4HMhmy7A/Z8KlK2Xcfu+ytzc6QuF1lWFP2puBETV11LWqNLgmBySW/aRo5dVV
1efRhL785tiTAXpBKDNj
=jdyZ
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 04 Apr 2016 07:31:23 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jan 6 10:34:47 2018; Machine Name: beach

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.