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

Bug#677175: libapt-pkg4.12: _error->StackCount not always reset after MakeStatusCache



Package: libapt-pkg4.12
Version: 0.9.5.1
Tags: patch

Noticed this while using PendingError in aptitude and getting some
strange behaviour.  PendingError returned false yet DumpErrors
immediately after would output errors.  Some quick debugging showed
that _error->StackCount had been increased somewhere.

In pkgcachegen.cc the function MakeStatusCache has a call to
PushToStack, followed by conditional calls to either Revert. or
Merge..  However, these are not enough to ensure that the stack count
is always left as it started.  If there is no error and Debug is false
then StackCount will remain incremented, hiding older errors from
subsequent calls to PendingError.

A quick check using 'grep -e Stack -R apt-pkg/ apt-inst/ cmdline/
methods/' reveals no similar problems.

Patch.

Applying this patch could affect the exit status of some apt-get
commands in some situations.  I can only see that it would be more
accurate in the presence of errors.

Regards

Attachment: errorstack.patch
Description: Binary data


Reply to: