Freezes when searching for "lib"

Bug #634449 reported by Austin Adams
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Fix Released
Medium
Mohamed Amine Ilidrissi

Bug Description

Binary package hint: software-center

Rather funny:
All other searches work fine, but if I search for "lib" in the Ubuntu Software Center 2.0.7 it locks up (in either "Installed Software" or "Get Software"); I have to "Force Quit" it. Installed packages starting with "lib" are also not showing up in "Installed Software" (specifically a package called "libticalcs2-7", which shows up in Synaptic Package Manager).

I'm using Ubuntu 10.04.1 on a Compaq Presario CQ60-419wm (Info about my hardware here: http://bit.ly/ninjaspecs).

Sorry if this bug is invalid or already mentioned.

Changed in software-center (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Michael Vogt (mvo)
Changed in software-center (Ubuntu):
milestone: none → ubuntu-10.10
Revision history for this message
Michael Vogt (mvo) wrote :

The problem is that the query parser can generate way too big querries, for lib its a 5000 entry long query. One possible fix is this, or we can limit it in appview.py and use the number there as a estimate for the amount of hits we probably get.

=== modified file 'softwarecenter/db/database.py'
--- softwarecenter/db/database.py 2010-08-20 13:06:38 +0000
+++ softwarecenter/db/database.py 2010-09-09 21:16:30 +0000
@@ -198,6 +198,12 @@
         fuzzy_query = self.xapian_parser.parse_query(search_term,
                                                xapian.QueryParser.FLAG_PARTIAL|
                                                xapian.QueryParser.FLAG_BOOLEAN)
+ # if the query size goes out of hand, omit the FLAG_PARTIAL
+ # (LP: #634449)
+ if fuzzy_query.get_length() > 1000:
+ fuzzy_query = self.xapian_parser.parse_query(
+ search_term, xapian.QueryParser.FLAG_BOOLEAN)
+ # now add categories
         fuzzy_query = _add_category_to_query(fuzzy_query)
         return [pkg_query,fuzzy_query]

Revision history for this message
Mohamed Amine Ilidrissi (ilidrissi.amine) wrote :

After a little investigating, I found that this doesn't hang indefinitely, it just takes too much time, and it gives the impression of a freeze. However, the code you gave greatly improve the situation, so I patched it in my branch. Thank you, mvo!

Revision history for this message
Austin Adams (ausbin) wrote :

Fascinating! Sorry for the misinformation that it freezes forever.
What goes on inside Ubuntu is always fascinating.

Thanks! :D

summary: - Searching for "lib" crashes Ubuntu Software Center
+ Freezes when searching for "lib"
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 2.1.21

---------------
software-center (2.1.21) maverick; urgency=low

  [ Michael Vogt ]
  * fix rendering of the "Installing purchase..." overview transaction,
    it contains a icon and a proper status now (LP: #637394)
  * fix flickering when a item is purchased
  * fix incorrect signal emited when a transactiosn returns a error
  * fix history date ordering (LP: #635198), many thanks to
    Mohamed Amine IL Idrissi
  * fix missing progress in pendingview regression

  [ Gary Lasker ]
  * softwarecenter/view/softwarepane.py,
    softwarecenter/view/availablepane.py,
    softwarecenter/view/channelpane.py,
    softwarecenter/view/installedpane.py:
    - fix visual flash when navigating back to a subcat
      applist from a details view (LP: #611108)

  [ Mohamed Amine IL Idrissi ]
  * softwarecenter/db/database.py: limit the query size to 1000 matches
    so USC does not freeze, many thanks Michael Vogt (LP: #634449)
 -- Michael Vogt <email address hidden> Thu, 16 Sep 2010 01:37:44 +0200

Changed in software-center (Ubuntu):
status: Confirmed → Fix Released
Changed in software-center (Ubuntu):
assignee: nobody → Mohamed Amine IL Idrissi (ilidrissi.amine)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.