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

Bug#374195: Can't do anything: "terminate called after throwing an instance of 'std::logic_error'"



I have seen this bug in version 0.6.42.3 and in my case the
"terminate" output was due to a bug in DPkgPM::Go.  That function
fails to parse status outputs from dpkg that span more than one line.

Specifically, this dpkg output causes DPkgPM::Go to crash (two lines):

status: big : error : Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.

Note the second line that starts with a space.  DPkgPM::Go can't deal
with that; it doesn't expect continuation lines at all.  Concretely,
it is not checking that the call to TokSplitString actually has found
the expected fields.  (Bad boy!  Go to bed without dinner!)

Using dpkg --force-remove-reinstreq just gets rid of the problematic
package and thus the bug is not triggered anymore.

Fixing the crash by simply ignoring the second line is of course the
easy and wrong solution.  DPkgPM::Go should be able to deal with
continuation lines like this.



Reply to: