[Aptitude-devel] "examine view" crashing in curse aptitude 0.5.3.1
dburrows at debian.org
Thu Jul 30 06:20:56 UTC 2009
On Wed, Jul 29, 2009 at 11:08:41PM -0700, Daniel Burrows <dburrows at debian.org> was heard to say:
> On Thu, Jul 30, 2009 at 02:04:00AM +0200, Alban Browaeys <prahal at yahoo.com> was heard to say:
> > This way ? It fixes the issue though it looks to me as it breaks the
> > design (as it make cache part of
> > the api, though this may be minor : probably is_valid_cache could be
> > replaced by is_valid and the function could
> > include more checks).
> > Mind that I am new to c++ so the usage of const may be invalid or the
> > function ought
> > to be in the .cc .
> I was thinking more this way.
Just to expand that thought: all the code around the resolver already
assumes that testing end() on the appropriately realized apt object
will check whether the object is valid. If I were designing it from
scratch I would probably make validity an intrinsic property of the
resolver objects and/or just wrap the ones where I might actually want
them to be invalid in something like boost::optional. But this is a
pretty minor wart, and just fixing the get_*() routines to return an
actual end iterator if "cache" is NULL instead of crashing will make
everything work again.
My earlier mail contains the changeset I committed this morning to
fix the bug. Also, once my Internet connection is working again (lousy
Linux wireless drivers) I'll push out some changes to fix crashes on
exit that you may have noticed. That might be tomorrow.
More information about the Aptitude-devel