GNOME Bugzilla – Bug 678378
ESourceRegistry causes deadlock in gnome-shell
Last modified: 2013-09-14 16:55:57 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.)
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
seems to work for me