Bug 78639

Summary: PackageKitGlib fail to do asynchronous search for package
Product: PackageKit Reporter: Lester Carballo Pérez <lestcape>
Component: client-libraryAssignee: Richard Hughes <richard>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium CC: lestcape
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Lester Carballo Pérez 2014-05-12 22:29:35 UTC
This code generate a core dump also the equivalent on cjs, 

My error? The synchronous version works well. Occurs the same on ubuntu 13.10 and 14.04, Fedora 20. I install packagekit on Ubuntu 13.10 and the same things...

https://ask.fedoraproject.org/en/question/46605/helps-on-develop-software-to-support-fedora/
https://answers.launchpad.net/ubuntu/+source/packagekit/+question/246795

#! /usr/bin/python3
# -*- coding: utf-8 -*-

from gi.repository import GObject
from gi.repository import PackageKitGlib as packagekit

def main():
    """Run a test application"""
    loop = GObject.MainLoop()
    pk = packagekit.Client()
    pk.search_names_async(0, ["xterm",], None, progress_cb, None, out_data, None)
    print("exec")
    loop.run()

def progress_cb(status, typ, data=None):
    if status.get_property('package'):
        print("Pachet " + status.get_property('package') + " " + status.get_property('package-id'))
    print(str(typ))

def out_data(p):
    print("ready")
    loop.quit()

if __name__ == "__main__":
    main()

Thanks.
Comment 1 Richard Hughes 2014-05-13 09:21:40 UTC
I get:

TypeError: expected tuple for callback user_data

I also don't get how out_data is supposed be accessing "loop".
Comment 2 Lester Carballo Pérez 2014-05-13 17:46:26 UTC
Yes, thanks for a quick response...
I update ubuntu, and i also see the typeError, this not appear on any place, some days ago, but clear this error it's not the cause, and this only force me to send an empty tuple instead of None value, because i do not need use any data. Sorry for have a loop out of scope, i try to make only an example, this is not my real code, and if i have an infinite loop, this not change any thing ofcourse.

New code without the typeError and without an infinite loop, but with the same core dump.

Thanks again!!!

#! /usr/bin/python3
# -*- coding: utf-8 -*-

from gi.repository import GObject
from gi.repository import PackageKitGlib as packagekit


loop = GObject.MainLoop()

def main():
    """Run a test application"""
    pk = packagekit.Client()
    pk.search_names_async(0, ["xterm",], None, progress_cb, (), out_data, ())
    print("exec")
    loop.run()

def progress_cb(status, typ, data=None):
    if status.get_property('package'):
        print("Pachet " + status.get_property('package') + " " + status.get_property('package-id'))
    print(str(typ))

def out_data(p, d, k):
    print("ready")
    loop.quit()

if __name__ == "__main__":
    main()
Comment 3 Lester Carballo Pérez 2014-05-13 18:13:51 UTC
See also, that where i need to have without any problem the asyncronous version it's only on cjs(Cinnamon Java Script) because i can have my service or an thread enviroment and use the syncronous version, but i can not do that on cjs, because on cjs I have only one thread(the compositor thread), and if i try to use the syncronous version over the compositor thread then will be blocked all cinnamon activities for a while...

On my opinion this is not a problem of packagekit, it's a problem of the Gnome wrapper, but i can not be complete sure about that, and i think that we are more interested on this than Gnome proyect, They have more things to worry about...
Comment 4 Richard Hughes 2018-08-21 15:52:36 UTC
We moved the upstream bugtracker to GitHub a long time ago. If this issue still affects you please re-create the issue here: https://github.com/hughsie/PackageKit/issues
 
Sorry for the impersonal message, and fingers crossed your issue no longer happens. Thanks.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.