Bug 69494

Summary: Thread safety issues in packagekit-glib
Product: PackageKit Reporter: Giovanni Campagna <scampa.giovanni>
Component: client-libraryAssignee: Richard Hughes <richard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: PkTask: make thread-default-context aware
PkTaskSync: don't iterate the default main context

Description Giovanni Campagna 2013-09-17 21:17:28 UTC
You know the rule: don't ever call g_main_loop_new(NULL).

I got a deadlock in gnome-software because a pluginloader thread was owning the default context.
Comment 1 Giovanni Campagna 2013-09-17 21:19:15 UTC
Created attachment 86022 [details] [review]
PkTask: make thread-default-context aware

We must install idle sources in the right main context, otherwise
PkTask becomes impossible to use thread safely.
Comment 2 Giovanni Campagna 2013-09-17 21:19:54 UTC
Created attachment 86023 [details] [review]
PkTaskSync: don't iterate the default main context

Iterating the default main context is wrong in all occasions (as
most applications are not prepared to deal with the reentrancy
caused by gtk+ sources). It becomes even more wrong if the library
is supposed to be thread safe, and the method is called from
a secondary thread.
Comment 3 Richard Hughes 2013-10-11 07:45:36 UTC
Both applied, 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.