Bug 69494 - Thread safety issues in packagekit-glib
Summary: Thread safety issues in packagekit-glib
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: client-library (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-17 21:17 UTC by Giovanni Campagna
Modified: 2013-10-11 07:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
PkTask: make thread-default-context aware (2.13 KB, patch)
2013-09-17 21:19 UTC, Giovanni Campagna
Details | Splinter Review
PkTaskSync: don't iterate the default main context (20.24 KB, patch)
2013-09-17 21:19 UTC, Giovanni Campagna
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.