Fix crash when opening DepCache before Cache

Bug #1815187 reported by Julian Andres Klode on 2019-02-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)

Bug Description

apt search and probably other code crashes some time, as GetDepCache() in trusty does not call BuildCaches() first.

[Test case]
Run apt search -o RootDir=/dev/null foobar, make sure it does not crash.

[Regression potential]
There may be some locking implications, as we build caches when opening depcache first, without locks. That said, the same code is in use in all post-trusty releases, and they work fine.

description: updated
Changed in apt (Ubuntu Trusty):
status: New → In Progress
Changed in apt (Ubuntu):
status: New → Fix Released

Hello Julian, or anyone else affected,

Accepted apt into trusty-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-trusty to verification-done-trusty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-trusty. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apt (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-trusty
Julian Andres Klode (juliank) wrote :

Broken in security (ubuntu2.19), fixed in proposed (ubuntu2.20).

root@tt:~# apt search -o RootDir=/dev/null foobar
Segmentation fault (core dumped)
root@tt:~# apt install apt libapt-pkg4.12
Unpacking libapt-pkg4.12:amd64 (1.0.1ubuntu2.20) over (1.0.1ubuntu2.19) ...
Unpacking apt (1.0.1ubuntu2.20) over (1.0.1ubuntu2.19) ...
root@tt:~# apt search -o RootDir=/dev/null foobar
W: Unable to read /dev/null/etc/apt/sources.list.d/ - DirectoryExists (20: Not a directory)
W: Unable to read /dev/null/etc/apt/sources.list - RealFileExists (20: Not a directory)
E: Could not open file /dev/null/var/lib/dpkg/status - open (20: Not a directory)
E: The package lists or status file could not be parsed or opened.

tags: added: verification-done verification-done-trusty
removed: verification-needed verification-needed-trusty
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.0.1ubuntu2.20

apt (1.0.1ubuntu2.20) trusty; urgency=medium

  [ Julian Andres Klode ]
  * Fix crashes in apt search, cache file (LP: #1815187)
  * Clean up some build artifacts and regenerate the po files

  [ Heitor R. Alves de Siqueira ]
  * backport "do not segfault in cache generation on mmap failure"
    (Closes: 803417) (LP: #1815129)

 -- Julian Andres Klode <email address hidden> Fri, 08 Feb 2019 13:12:26 +0100

Changed in apt (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for apt has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers