After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678378 - ESourceRegistry causes deadlock in gnome-shell
ESourceRegistry causes deadlock in gnome-shell
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
3.6.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
evolution[account-mgmt]
Depends on:
Blocks:
 
 
Reported: 2012-06-19 09:11 UTC by Alexander Larsson
Modified: 2013-09-14 16:55 UTC
See Also:
GNOME target: 3.6
GNOME version: ---



Description Alexander Larsson 2012-06-19 09:11:09 UTC
The eds integration in gnome-shell calls e_source_registry_new() on the main thread, but this is an async op that works by running the init code in another thread.

In particular it will run source_registry_initable_init, which at line 988:
http://git.gnome.org/browse/evolution-data-server/tree/libedataserver/e-source-registry.c#n988

iterates registry->priv->main_context, which is set to the thread default main context at initialization time, which in this case is the default main context.

Iterating the default main context inside some call is generally a bad idea (it introduces reentrancy), but doing it in a different thread is even worse. 

In this case it means we will run random gnome-shell sources on a different thread, causing a callout to some javascript code, causing a deadlock in the js GC code because its not set up to run js code from multiple threads. (I think this is what happens, it ends up being deadlocked in the GC code and if i remove the mainloop iterating it doesn't.)
Comment 1 Matthew Barnes 2012-06-19 12:55:39 UTC
I reworked the registry initialization to avoid having to iterate a main context at all, and it's actually simpler now.  Reopen if there's still problems.

http://git.gnome.org/browse/evolution-data-server/commit/?id=5ec01de3ba2a7daf6bf5f43351f7f6e7c00a28f4

http://git.gnome.org/browse/evolution-data-server/commit/?id=be7e0e49bba18e6f46d50394df0cd28f45e71379
Comment 2 Alexander Larsson 2012-06-19 13:46:59 UTC
seems to work for me