When testing the fix for a similar crash in bug 920196, I found that even with that fix I was able to cause a crash by repeatedly clicking the "All Software" button while Software Center is starting up.
The stacktrace is shown below.
TEST CASE:
1. open stock software-center
2. click on the "All Software" button very quickly while the main page is still loading
3. verify that there is a traceback (note that this does not happen always, just most of the time)
4. use the fixed version from -proposed
5. verify that (2) no longer produces the following (or any) traceback
Traceback (most recent call last):
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/enquire.py", line 115, in _get_estimate_nr_apps_and_nr_pkgs
tmp_matches = enquire.get_mset(0, len(self.db), None, xfilter)
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/appfilter.py", line 89, in __call__
if (not pkgname in self.cache and
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/pkginfo_impl/aptcache.py", line 263, in __contains__
return self._cache.__contains__(k)
AttributeError: 'NoneType' object has no attribute '__contains__'
Traceback (most recent call last):
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/panes/viewswitcher.py", line 149, in config_view
pane = vm.set_active_view(view_id)
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/session/viewmanager.py", line 149, in set_active_view
view_widget.init_view()
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/panes/availablepane.py", line 168, in init_view
self.apps_filter)
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/views/catview_gtk.py", line 240, in __init__
self.build(desktopdir)
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/views/catview_gtk.py", line 492, in build
self._build_homepage_view()
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/views/catview_gtk.py", line 267, in _build_homepage_view
self._append_top_rated()
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/views/catview_gtk.py", line 404, in _append_top_rated
top_rated_cat = self._update_top_rated_content()
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/ui/gtk3/views/catview_gtk.py", line 391, in _update_top_rated_content
docs = top_rated_cat.get_documents(self.db)
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/categories.py", line 124, in get_documents
nonblocking_load=False)
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/enquire.py", line 317, in set_query
self._blocking_perform_search()
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/enquire.py", line 212, in _blocking_perform_search
matches = enquire.get_mset(0, self.limit, None, xfilter)
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/appfilter.py", line 89, in __call__
if (not pkgname in self.cache and
File "/home/tremolux/Projects/precise/software-center_fix_crash_lp920196/5.2/softwarecenter/db/pkginfo_impl/aptcache.py", line 263, in __contains__
return self._cache.__contains__(k)
AttributeError: 'NoneType' object has no attribute '__contains__'
Software Center 5.2.1, Ubuntu 10.04
When testing the fix for a similar crash in bug 920196, I found that even with that fix I was able to cause a crash by repeatedly clicking the "All Software" button while Software Center is starting up.
The stacktrace is shown below.
TEST CASE:
1. open stock software-center
2. click on the "All Software" button very quickly while the main page is still loading
3. verify that there is a traceback (note that this does not happen always, just most of the time)
4. use the fixed version from -proposed
5. verify that (2) no longer produces the following (or any) traceback
Traceback (most recent call last): tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ enquire. py", line 115, in _get_estimate_ nr_apps_ and_nr_ pkgs tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ appfilter. py", line 89, in __call__ tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ pkginfo_ impl/aptcache. py", line 263, in __contains__ __contains_ _(k) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/panes/ viewswitcher. py", line 149, in config_view active_ view(view_ id) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/session/ viewmanager. py", line 149, in set_active_view widget. init_view( ) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/panes/ availablepane. py", line 168, in init_view apps_filter) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/views/ catview_ gtk.py" , line 240, in __init__ build(desktopdi r) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/views/ catview_ gtk.py" , line 492, in build _build_ homepage_ view() tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/views/ catview_ gtk.py" , line 267, in _build_ homepage_ view _append_ top_rated( ) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/views/ catview_ gtk.py" , line 404, in _append_top_rated top_rated_ content( ) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/ui/ gtk3/views/ catview_ gtk.py" , line 391, in _update_ top_rated_ content cat.get_ documents( self.db) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ categories. py", line 124, in get_documents _load=False) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ enquire. py", line 317, in set_query _blocking_ perform_ search( ) tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ enquire. py", line 212, in _blocking_ perform_ search tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ appfilter. py", line 89, in __call__ tremolux/ Projects/ precise/ software- center_ fix_crash_ lp920196/ 5.2/softwarecen ter/db/ pkginfo_ impl/aptcache. py", line 263, in __contains__ __contains_ _(k)
File "/home/
tmp_matches = enquire.get_mset(0, len(self.db), None, xfilter)
File "/home/
if (not pkgname in self.cache and
File "/home/
return self._cache.
AttributeError: 'NoneType' object has no attribute '__contains__'
Traceback (most recent call last):
File "/home/
pane = vm.set_
File "/home/
view_
File "/home/
self.
File "/home/
self.
File "/home/
self.
File "/home/
self.
File "/home/
top_rated_cat = self._update_
File "/home/
docs = top_rated_
File "/home/
nonblocking
File "/home/
self.
File "/home/
matches = enquire.get_mset(0, self.limit, None, xfilter)
File "/home/
if (not pkgname in self.cache and
File "/home/
return self._cache.
AttributeError: 'NoneType' object has no attribute '__contains__'