[Bug 597772] New:=?UTF-8?Q?=20=E2=80=9CFind=E2=80=9D=20function=20in=20gpk=2Dapplication=20is=20limited=20to=20accurate=20match?=
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c0 Summary: “Find” function in gpk-application is limited to accurate match Classification: openSUSE Product: openSUSE 11.3 Version: Factory Platform: x86 OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: libzypp AssignedTo: zypp-maintainers@forge.provo.novell.com ReportedBy: peter.j.zhu@intel.com QAContact: qa@suse.de Found By: --- Blocker: --- Created an attachment (id=355284) --> (http://bugzilla.novell.com/attachment.cgi?id=355284) log info of pk zypp backend User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) The Find” function in gpk-application is limited to accurate match, it means we need to fill the full package name for search, the behavior seems incompatible with the upstream gnome-packagekit. In upstream gnome-packagekit project using yum backend, the “find” function defined like this: “You can select to search for a string that is contained in package name, the package description, or search for the name of a file contained in the package”. Reproducible: Always Steps to Reproduce: (1)open gpk-application. (2)find one package using “find” function. Such as "vim-common" (3)it can find the package if using keyword "vim-common" (3)it cannot find the package if using keyword "vim" Expected Results: Can search one package by using a string that is contained in package name, the package description, or search for the name of a file contained in the package. I attached log info here. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c1 --- Comment #1 from Peter Zhu <peter.j.zhu@intel.com> 2010-04-19 13:34:15 UTC --- Created an attachment (id=355285) --> (http://bugzilla.novell.com/attachment.cgi?id=355285) packagekitd daemon info executing the two search This is packagekitd daemon log info executing the two search -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c2 --- Comment #2 from Peter Zhu <peter.j.zhu@intel.com> 2010-04-19 14:17:21 UTC --- Forgot to say, this is happening in PK0.63 and gnome-packagekit 2.30.0 in a meego system -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c3 Michael Andres <ma@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ma@novell.com Component|libzypp |GNOME AssignedTo|zypp-maintainers@forge.prov |sreeves@novell.com |o.novell.com | --- Comment #3 from Michael Andres <ma@novell.com> 2010-04-21 16:24:50 UTC --- Having a glimpse at the backend code, I see some switch in pk-backend-zypp.cpp(backend_find_packages_thread) that calls zypp_get_packages_by_name, _by_details or _by_file (in zypp-utils.cpp) to perform the search. zypp_get_packages_by_name uses exact matching, probably because it's used from other locations too. I also see a memory leak in backend_find_packages_thread. Don't know whether it's actually necessary to use dynamically allocated 'std::vector', but the pointer should not be initialized with 'new std::vector' if later the query result is simply assigned. I don't know why this is not implemented using a plain std::vector. Other methods like zypp_get_patches also return pointer to allocated memory, but not all calling locations save the pointer and take care about calling delete. If all those really need to be created dynamically, it cries for a RAII solution. @Scott: I attach 2 (untested) patches. One for the memory leak and my suggestion how to fix backend_find_packages using a PoolQuery. The comments suggested that you'd like to support multiple search strings (OR'ed). PoolQuery would be able to do this. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c4 --- Comment #4 from Michael Andres <ma@novell.com> 2010-04-21 16:26:10 UTC --- Created an attachment (id=355993) --> (http://bugzilla.novell.com/attachment.cgi?id=355993) memory leak patch -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c5 --- Comment #5 from Michael Andres <ma@novell.com> 2010-04-21 16:27:03 UTC --- Created an attachment (id=355994) --> (http://bugzilla.novell.com/attachment.cgi?id=355994) find packages fix using PoolQuery -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c6 --- Comment #6 from Peter Zhu <peter.j.zhu@intel.com> 2010-04-22 09:15:13 UTC --- (In reply to comment #3)
Having a glimpse at the backend code, I see some switch in pk-backend-zypp.cpp(backend_find_packages_thread) that calls zypp_get_packages_by_name, _by_details or _by_file (in zypp-utils.cpp) to perform the search.
zypp_get_packages_by_name uses exact matching, probably because it's used from other locations too.
I also see a memory leak in backend_find_packages_thread. Don't know whether it's actually necessary to use dynamically allocated 'std::vector', but the pointer should not be initialized with 'new std::vector' if later the query result is simply assigned. I don't know why this is not implemented using a plain std::vector. Other methods like zypp_get_patches also return pointer to allocated memory, but not all calling locations save the pointer and take care about calling delete. If all those really need to be created dynamically, it cries for a RAII solution.
@Scott: I attach 2 (untested) patches. One for the memory leak and my suggestion how to fix backend_find_packages using a PoolQuery. The comments suggested that you'd like to support multiple search strings (OR'ed). PoolQuery would be able to do this.
Thanks Michael. The two patches work very well and fix the find issue -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c7 Vincent Untz <vuntz@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vuntz@novell.com --- Comment #7 from Vincent Untz <vuntz@novell.com> 2010-06-03 23:58:51 UTC --- Hrm, wouldn't this upstream patch fix it: http://git.gnome.org/browse/gnome-packagekit/commit/?h=gnome-2-30&id=2e63a65b25d1235afaffaeb227b6f3d87e9d9e62 ? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c8 Vincent Untz <vuntz@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |coolo@novell.com --- Comment #8 from Vincent Untz <vuntz@novell.com> 2010-06-04 00:20:03 UTC --- I just checked, and indeed, it fixes the issue for me. coolo: would it be possible to update gnome-packagekit to 2.30.2 (up from 2.30.1)? It contains only a few fixes, including this one and a change to ignore more useless error messages. See the log from git http://git.gnome.org/browse/gnome-packagekit/log/?h=GNOME_PACKAGEKIT_2_30_2 and the diff between the two versions http://git.gnome.org/browse/gnome-packagekit/diff/?h=GNOME_PACKAGEKIT_2_30_2&id=045858ea3b6eadb534d71648a1ab3e92198052da&id2=c80493a193715717b96ad0d2527f5c1d5ea30f9b and the rdiff for the package https://build.opensuse.org/package/rdiff?opackage=gnome-packagekit&oproject=GNOME%3AFactory&package=gnome-packagekit&project=home%3Avuntz%3Abranches%3AGNOME%3AFactory -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c9 Stephan Kulow <coolo@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|coolo@novell.com | --- Comment #9 from Stephan Kulow <coolo@novell.com> 2010-06-04 10:31:08 CEST --- I consider it very risky updating the updater, but the changelog looks ok. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c10 Vincent Untz <vuntz@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|“Find” function in |Memory leak in PackageKit |gpk-application is limited |zypp backend (see comment |to accurate match |4) --- Comment #10 from Vincent Untz <vuntz@novell.com> 2010-06-04 08:54:05 UTC --- Thanks. I agree it'd be risky for the updater itself, but it really hasn't changed (except to fix build warnings); the other changes are for other parts of gnome-packagekit. I forwarded it to factory (sr#41083). Keeping the bug open for the memory leak (see comment #4). -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=597772 http://bugzilla.novell.com/show_bug.cgi?id=597772#c11 Vincent Untz <vuntz@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #11 from Vincent Untz <vuntz@novell.com> 2010-06-04 12:11:26 UTC --- Ah, actually, the memleak was fixed upstream too. So closing. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com