GNOME Bugzilla – Bug 578197
crash when gtk-find returns null
Last modified: 2009-08-02 06:50:59 UTC
When I run gnome-shell, it starts up Xephyr and shows the X icon, Geyes, and a terminal, then crashes quickly and fails with this error: JS ERROR: !!! message = 'icontheme.lookup_icon("gtk-find", 16, 0) is null The attached patch works around the problem by adding a try/catch block around the code. I don't have a program named gtk-find on my system, so perhaps that is the problem. With my patch, I still get warning messages like this: JS LOG: Error finding icon TypeError: icontheme.lookup_icon("gtk-find", 16, 0) is null But it doesn't crash, so I'd think adding the try/catch logic upstream would be a good idea. I'd also appreciate any advice about what I need to do to fix the gtk-find issue so it works better.
This is in js/ui/overlay.js:120 > let searchIconPath = icontheme.lookup_icon('gtk-find', 16, 0).get_filename(); > searchIconTexture.set_from_file(searchIconPath); The problem is, gtk-find is a GTK stock icon, and as such I'm not convinced it can't be inlined in the library; thus the icon file would not exist when you're using the default icon theme. Just an idea. The natural way of using a stock icon would be to load it into a GdkPixbuf, and then use the pixbuf. Would Clutter::Texture::set_from_rgb_data() work? Anyway, using catch to avoid a crash is not really useful IMHO, since we need this search icon anyway, and any consistent system must have it.
Right, "gtk-find" isn't a program, it's an icon. Brian, can you run the program (executable) "gtk-demo" and double click on the "Stock Item and Icon Browser" entry? Do you see icons there? If so, the problem most likely relates to some jhbuild difference. For example if there's an invalid or out-of-date icon cache in the jhbuild root, or we're not picking up icons from the system GTK+ install correctly.
As Milan says, gtk-find is primarily a stock icon, and the default stock icon images are built into GTK+, so can only be loaded as pixbufs, and not as files.
Running gtk-demo works, and I can see the GTK_STOCK_FIND icon just fine. I'm sorry, but I am not very familiar with Python, so I'm unsure how to provide more information. If you have any debugging tips, please share. Note that I am not using jhbuild, since jhbuild doesn't run on Solaris. I built gnome-shell and its dependencies by hand. So, this problem could also be caused by something wrong in the way I installed GNOME shell. I installed gobject-introspection, gjs, gir-repository, metacity-clutter, and then gnome-shell.
Brian, could you try setting a different icon theme? Most themes other than the standard one should override stock icons with files instead of using GTK built-in icons, and that should solve the bug. But what theme are you using? Even the default 'gnome' theme provides such files. An easy workaround would be to use the 'system-search' icon instead of 'gtk-find', that would guarantee it's not built-in, and it should give the same result. But there's a more general issue here between Clutter and GTK...
Just changing "gtk-find" to "system-search", and running again. I see it triggers the same problem. So I don't think this is an issue with built-in.
Created attachment 132361 [details] [review] 0001-Bug-578197-Handle-builtin-icons.patch
I tried your patch instead of using my try/catch patch. I had to copy the gtkutils.js file into /usr/share/gnome-shell/js/ui for this to work. Once I did this, I no longer see issues about the icon, but instead I get these errors: JS ERROR: !!! Exception was: Error: Requiring GtkClutter, version none: Typelib file for namespace 'GtkClutter' (any version) not found JS ERROR: !!! lineNumber = '0' JS ERROR: !!! fileName = 'gjs_throw' JS ERROR: !!! stack = 'Error("Requiring GtkClutter, version none: Typelib file for namespace 'GtkClutter' (any version) not found")@:0 ("Requiring GtkClutter, version none: Typelib file for namespace 'GtkClutter' (any version) not found")@gjs_throw:0 @/usr/share/gnome-shell/js/ui/gtkutil.js:6 Not sure what I need to do to fix this. Do I need to install clutter-gtk 0.9 or something? There isn't a distribution tarball, so perhaps from git head? Thanks.
Ah right, this patch depends on http://bugzilla.o-hand.com/show_bug.cgi?id=1490 I think I can rework it to not depend on GtkClutter though since we have our own duplicates of the functions I'm using.
Created attachment 132410 [details] [review] 0001-Bug-578197-Handle-builtin-icons.patch
Installing Clutter-GTK from GIT head with your patch from bug 1490, and then using your patch from comment #10 seems to work fine. Thanks for helping me to work through this issue.
Created attachment 132716 [details] [review] rebased to master
Created attachment 134069 [details] [review] New version to remove NO_SVG flag (2 lines) Should fix bug 578041 BTW. I've not updated the author, so you must agree with my change... ;-)
*** Bug 578041 has been marked as a duplicate of this bug. ***
*** Bug 587888 has been marked as a duplicate of this bug. ***
Needs to be redone in the ShellTextureCache C code. (NO_SVG is not used by ShellTextureCache, so that has already been fixed.)
This one I fixed on the side in bug 590493 *** This bug has been marked as a duplicate of 590493 ***