<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg/cachefile.cc, branch 1.4.3</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=1.4.3</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=1.4.3'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2016-05-20T07:37:24Z</updated>
<entry>
<title>fail instead of segfault on unreadable config files</title>
<updated>2016-05-20T07:37:24Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2016-05-20T07:37:24Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=fdf9eef4d96a18d0167708499c993e1174251e88'/>
<id>urn:sha1:fdf9eef4d96a18d0167708499c993e1174251e88</id>
<content type='text'>
The report mentions "apt list --upgradable", but there are others which
have inconsistent behavior ranging from segfaulting to doing something
with the partial (and hence incomplete) data. We had a recent report
about sources.list (#818628), this one mentions prefences, the obvious
next step is conf files… so the testcase is adapted to check for all
three in file and directory versions and run a bunch of commands each
time which should all have more or less the same behavior in such a case
(aka error out).

Closes: 824503
</content>
</entry>
<entry>
<title>cachefile: Only set members that were initialized successfully</title>
<updated>2016-03-19T06:19:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2016-03-19T00:56:38Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=f40fdaa43271edf98b80c08e20f401b5da591501'/>
<id>urn:sha1:f40fdaa43271edf98b80c08e20f401b5da591501</id>
<content type='text'>
Otherwise, things will just start failing later down the stack,
because (a) the lazy getters do not check if building was successful
and (b) any further getter call would return the invalid object
anyway.

Also initialize VS in pkgCache to nullptr by default.

Closes: #818628
</content>
</entry>
<entry>
<title>get dpkg lock in build-dep if cache was invalid again</title>
<updated>2016-02-10T12:03:00Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2016-02-10T11:26:49Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=b6f1b480164b454661ddd4fdd3968302c6a3ebf6'/>
<id>urn:sha1:b6f1b480164b454661ddd4fdd3968302c6a3ebf6</id>
<content type='text'>
Regression introduced in a249b3e6fd798935a02b769149c9791a6fa6ef16, which
in the case of an invalid cache would build the first part unlocked and
later pick up the (still unlocked) cache for further processing, so the
system got never locked and apt would end up complaining about being
unable to release the lock at shutdown.

The far more common case of having a valid cache worked as expected and
hence covered up the problem – especially as tests who would have
noticed it are simulations only, which do not lock.

Closes: 814139
Reported-By: Balint Reczey &lt;balint@balintreczey.hu&gt;
Reported-By: Helmut Grohne &lt;helmut@subdivi.de&gt; on IRC
</content>
</entry>
<entry>
<title>deal better with (very) small apt::cache-start values</title>
<updated>2016-01-26T23:15:12Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2016-01-26T23:15:12Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=a133f79c8766aee5b7d7811285e60b3d311d8473'/>
<id>urn:sha1:a133f79c8766aee5b7d7811285e60b3d311d8473</id>
<content type='text'>
It is a bit academic to support values which aren't big enough to fit even
the hashtables without resizing, but cleaning up ensures that we do the
right thing (aka not segfaulting) even if something goes wrong in these
deep layers. You still can't have very very small values through…

Git-Dch: Ignore
</content>
</entry>
<entry>
<title>reimplement build-dep via apts normal resolver</title>
<updated>2016-01-25T17:15:44Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2016-01-21T22:22:00Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=a249b3e6fd798935a02b769149c9791a6fa6ef16'/>
<id>urn:sha1:a249b3e6fd798935a02b769149c9791a6fa6ef16</id>
<content type='text'>
build-dep was implemented by parsing the build-dependencies of a package
and figuring out which packages to install/remove based on this. That
means that for the first level of dependencies build-dep was
implementing its very own resolver with all the benefits (aka: bugs)
this gives us for not using the existing resolver for all levels.

Making this work involves generating a dummy binary package with fitting
Depends and Conflicts and as we can't create them out of thin air the
cache generation needs to be involved so we end up writing a Packages
file which we want to parse – after we have parsed the other Packages
files already. With .dsc/.deb files we could add them before we started
parsing anything.

With a bit of care we can avoid generating too much data we have to
throw away again (as many parts assume that e.g. the count of packages
doesn't change midair), so that on a speed front there shouldn't be
much of a difference, but output can be slightly confusing as if we have
a completely valid cache on disk the "Reading package lists... Done" is
printed two times – but apt is pretty quick about it in that case.

Closes: #137560, #444930, #489911, #583914, #728317, #812173
</content>
</entry>
<entry>
<title>pkgCacheGenerator: Allow passing down an already created cache</title>
<updated>2015-12-29T15:29:05Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2015-12-29T14:59:41Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=f161603953f92cc3e778439d7149e5b852f65277'/>
<id>urn:sha1:f161603953f92cc3e778439d7149e5b852f65277</id>
<content type='text'>
If we already have opened a cache, there is no point in having
to open it again.
</content>
</entry>
<entry>
<title>do not segfault in cache generation on mmap failure</title>
<updated>2015-11-19T23:54:07Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2015-11-19T23:54:07Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=6789e01e9370b3b7f65d52138c5657eaa712b4d1'/>
<id>urn:sha1:6789e01e9370b3b7f65d52138c5657eaa712b4d1</id>
<content type='text'>
Out of memory and similar circumstanzas could cause MMap::Map to fail
and especially the mmap/malloc calls in it. With some additional
checking we can avoid segfaults and similar in such situations – at
least in theory as if this is a real out of memory everything we do to
handle the error could just as well run into a memory problem as well…

But at least in theory (if MMap::Map is made to fail always) we can deal
with it so good that a user actually never sees a failure (as the cache
it tries to load with it fails and is discarded, so that DynamicMMap
takes over and a new one is build) instead of segfaulting.

Closes: 803417
</content>
</entry>
<entry>
<title>wrap every unlink call to check for != /dev/null</title>
<updated>2015-11-04T17:42:28Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2015-11-02T17:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=ce1f3a2c616b86da657c1c796efa5f4d18c30c39'/>
<id>urn:sha1:ce1f3a2c616b86da657c1c796efa5f4d18c30c39</id>
<content type='text'>
Unlinking /dev/null is bad, we shouldn't do that. Also, we should print
at least a warning if we tried to unlink a file but didn't manage to
pull it of (ignoring the case were the file is /dev/null or doesn't
exist in the first place).

This got triggered by a relatively unlikely to cause problem in
pkgAcquire::Worker::PrepareFiles which would while temporary
uncompressed files (which are set to keep compressed) figure out that to
files are the same and prepare for sharing by deleting them. Bad move.
That also shows why not printing a warning is a bad idea as this hide
the error for in non-root test runs.

Git-Dch: Ignore
</content>
</entry>
<entry>
<title>avoid using global PendingError to avoid failing too often too soon</title>
<updated>2015-09-14T13:22:18Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2015-09-10T17:00:51Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=95278287f4e1eeaf5d96749d6fc9bfc53fb400d0'/>
<id>urn:sha1:95278287f4e1eeaf5d96749d6fc9bfc53fb400d0</id>
<content type='text'>
Our error reporting is historically grown into some kind of mess.
A while ago I implemented stacking for the global error which is used in
this commit now to wrap calls to functions which do not report (all)
errors via return, so that only failures in those calls cause a failure
to propergate down the chain rather than failing if anything
(potentially totally unrelated) has failed at some point in the past.

This way we can avoid stopping the entire acquire process just because a
single source produced an error for example. It also means that after
the acquire process the cache is generated – even if the acquire
process had failures – as we still have the old good data around we can and
should generate a cache for (again).

There are probably more instances of this hiding, but all these looked
like the easiest to work with and fix with reasonable (aka net-positive)
effects.
</content>
</entry>
<entry>
<title>ignore AllowMem parameter in cache generation</title>
<updated>2015-08-27T09:27:44Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2015-08-22T09:56:38Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=c4171975018eca191426dc1466b61a967e08921f'/>
<id>urn:sha1:c4171975018eca191426dc1466b61a967e08921f</id>
<content type='text'>
The parameter name suggests that it should forbid the building of the
entire cache in memory, but this isn't how it was previously and as
AllowMem is false by default it actually prevents previous usecases from
working like being root and configuring apt to build no caches at all.

This should be fixed at some point to actually work, but that is hard to
pull off as it means switching the default and some callers (including
apt itself) actually did call it explicitly with false in certain
cases for no apparent reason (at least now where it is common to have
enough memory to throw at every problem and even if not is a slow apt
usally better than an apt erroring out).

Closes: 796459
</content>
</entry>
</feed>
