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 692845 - shell crash after use switching
shell crash after use switching
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.7.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 693722 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-01-29 23:42 UTC by William Jon McCann
Modified: 2013-02-14 21:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
st-texture-cache: Remove a no-op scale pixbuf (1.51 KB, patch)
2013-02-14 21:09 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-texture-cache: Add one simple way to free texture load data (1.11 KB, patch)
2013-02-14 21:09 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-texture-cache: Use async variants of the icon loading API (6.72 KB, patch)
2013-02-14 21:09 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st-texture-cache: Use async variants of the icon loading API (6.27 KB, patch)
2013-02-14 21:18 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description William Jon McCann 2013-01-29 23:42:17 UTC
I have been seeing a pretty regular shell crash lately in jhbuild. I usually see it after fast user switching.

**
Gtk:ERROR:gtkicontheme.c:3526:proxy_symbolic_pixbuf_destroy: assertion failed: (symbolic_cache != NULL)
gnome-session[2577]: WARNING: Application 'gnome-shell.desktop' killed by signal 6
** Message: applet now removed from the notification area
Comment 1 Giovanni Campagna 2013-01-30 10:03:37 UTC
I've seen this too. I believe this is a race condition in GtkIconTheme, uncovered when SVG loading became threadsafe (and thus unlocked).

I haven't had the chance to debug or fix it, though.
Comment 2 Giovanni Campagna 2013-01-31 16:48:11 UTC
Ok, so I looked at GtkIconTheme a bit, and I don't see an easy way to make it threadsafe.
It should be possible to make icon loading async in Gtk, though.

I'll open a Gtk bug.
Comment 3 Matthias Clasen 2013-02-01 01:26:28 UTC
no gtk api has ever been threadsafe, including gtk_icon_theme_...
you are supposed to take the gdk lock when calling it from other threads
Comment 4 Giovanni Campagna 2013-02-01 10:05:00 UTC
But that defeats the point of using more threads, because then you are completely serialized.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-02-01 17:40:53 UTC
We don't use gtk_icon_theme API on any thread but the main thread, as far as I can tell. It's the pixbuf loader API that actually loads the image that should be threadsafe.
Comment 6 Giovanni Campagna 2013-02-01 19:05:13 UTC
No, we call gtk_icon_info_load_icon (load_symbolic), from impl_load_pixbuf_gicon, which is called from load_pixbuf_thread, itself called from a threaded GSimpleAsyncResult.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-02-01 19:31:28 UTC
As far as I'm aware, that simply loads the file using GdkPixbuf, which should be thread-safe.
Comment 8 Giovanni Campagna 2013-02-02 15:07:13 UTC
Nope, it frobs the GtkIconInfo structure to cache the loaded GdkPixbuf, and that's not threadsafe (in particular, there is a lot of caching which involves symbolic icons, so the window for a crash becomes larger there)
Comment 9 Giovanni Campagna 2013-02-13 16:26:38 UTC
*** Bug 693722 has been marked as a duplicate of this bug. ***
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:09:06 UTC
Created attachment 236155 [details] [review]
st-texture-cache: Remove a no-op scale pixbuf

We already passed GtkIconTheme the size when it wanted to load it,
so it knows the desired size and will scale it to what we want.
Comment 11 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:09:09 UTC
Created attachment 236156 [details] [review]
st-texture-cache: Add one simple way to free texture load data
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:09:11 UTC
Created attachment 236157 [details] [review]
st-texture-cache: Use async variants of the icon loading API

While we were relying on gtk_icon_info_load_icon and friends being
thread-safe, there was no such guarantee, and recent caching that
was added to GTK+ made it non-threadsafe. To replace it, _async()
variants of the icon loading code were added that are thread-safe.
Use those instead of using our own worker threads.
Comment 13 Giovanni Campagna 2013-02-14 21:17:23 UTC
Review of attachment 236155 [details] [review]:

Sure.
Comment 14 Giovanni Campagna 2013-02-14 21:18:08 UTC
Review of attachment 236156 [details] [review]:

Definitely.
Although while you're there, you should probably use GSlice for the structure.
Comment 15 Florian Müllner 2013-02-14 21:18:23 UTC
Review of attachment 236156 [details] [review]:

Sure.
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:18:44 UTC
Created attachment 236164 [details] [review]
st-texture-cache: Use async variants of the icon loading API

While we were relying on gtk_icon_info_load_icon and friends being
thread-safe, there was no such guarantee, and recent caching that
was added to GTK+ made it non-threadsafe. To replace it, _async()
variants of the icon loading code were added that are thread-safe.
Use those instead of using our own worker threads.



Clean up the patch; make the error case do what it did before (remove
the outstanding request, etc.)
Comment 17 Giovanni Campagna 2013-02-14 21:38:48 UTC
Review of attachment 236164 [details] [review]:

Tested locally, looks good to me.
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:41:08 UTC
Attachment 236155 [details] pushed as f1cdce3 - st-texture-cache: Remove a no-op scale pixbuf
Attachment 236156 [details] pushed as a5d3f77 - st-texture-cache: Add one simple way to free texture load data
Attachment 236164 [details] pushed as 7fc2b33 - st-texture-cache: Use async variants of the icon loading API