[Aptitude-devel] "examine view" crashing in curse aptitude 0.5.3.1
prahal at yahoo.com
Thu Jul 30 00:04:00 UTC 2009
Daniel Burrows a écrit :
> On Tue, Jul 28, 2009 at 02:28:34PM +0200, Alban Browaeys <prahal at yahoo.com> was heard to say:
>> To reproduce I do an "U" then "e" in aptitude --no-gui -t experimental
>> update_dep_display seems broken to me . It calls d.get_dep() on a d that
>> could be set to have cache int 0 and start int 4 (because of the
>> unhighlights that cause this d to be an invalid d as told in the empty
>> args constructor for aptitude_resolver_dep )
> get_dep().end() is the proper way to test for whether a dependency is
> valid. For dependencies constructed with the default constructor, it
> should return an end iterator. Unfortunately, this got broken when the
> universe layer was rewritten to conserve memory. Easy to fix, though:
> just have end() check or a NULL cache.
> Aptitude-devel mailing list
> Aptitude-devel at lists.alioth.debian.org
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
to be in the .cc .
Thank you for the hint on what would be best .
PS: I did not report the bug in the end as it was already done in
The gdb trace is identical. (though less complete).
diff -r 4b8a7d0e706d src/generic/apt/aptitude_resolver_universe.h
--- a/src/generic/apt/aptitude_resolver_universe.h Tue Jul 28
08:26:51 2009 -0700
+++ b/src/generic/apt/aptitude_resolver_universe.h Thu Jul 30
01:51:34 2009 +0200
@@ -474,6 +474,10 @@
bool broken_under(const InstallationType &I) const;
+ bool is_valid_cache() const
+ return !!cache;
/** \return The APT dependency associated with this abstract
pkgCache::DepIterator get_dep() const
diff -r 4b8a7d0e706d src/solution_screen.cc
--- a/src/solution_screen.cc Tue Jul 28 08:26:51 2009 -0700
+++ b/src/solution_screen.cc Thu Jul 30 01:51:34 2009 +0200
@@ -583,7 +583,7 @@
+ if(!d.is_valid_cache() || d.get_dep().end())
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 900 bytes
Desc: not available
More information about the Aptitude-devel