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 578197 - crash when gtk-find returns null
crash when gtk-find returns null
Status: RESOLVED DUPLICATE of bug 590493
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other opensolaris
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 578041 587888 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-07 06:05 UTC by Brian Cameron
Modified: 2009-08-02 06:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Bug-578197-Handle-builtin-icons.patch (3.68 KB, patch)
2009-04-08 19:34 UTC, Colin Walters
none Details | Review
0001-Bug-578197-Handle-builtin-icons.patch (3.62 KB, patch)
2009-04-09 14:43 UTC, Colin Walters
none Details | Review
rebased to master (3.42 KB, patch)
2009-04-15 17:27 UTC, Colin Walters
none Details | Review
New version to remove NO_SVG flag (2 lines) (3.44 KB, patch)
2009-05-05 21:30 UTC, Milan Bouchet-Valat
needs-work Details | Review

Description Brian Cameron 2009-04-07 06:05:07 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.
Comment 1 Milan Bouchet-Valat 2009-04-07 08:09:06 UTC
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.
Comment 2 Colin Walters 2009-04-07 15:53:59 UTC
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.
Comment 3 Owen Taylor 2009-04-07 16:03:01 UTC
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.
Comment 4 Brian Cameron 2009-04-07 16:27:16 UTC
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.
Comment 5 Milan Bouchet-Valat 2009-04-07 16:58:13 UTC
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...
Comment 6 Brian Cameron 2009-04-07 17:26:26 UTC
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.
Comment 7 Colin Walters 2009-04-08 19:34:14 UTC
Created attachment 132361 [details] [review]
0001-Bug-578197-Handle-builtin-icons.patch
Comment 8 Brian Cameron 2009-04-08 22:15:44 UTC
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.
Comment 9 Colin Walters 2009-04-09 14:20:13 UTC
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.
Comment 10 Colin Walters 2009-04-09 14:43:51 UTC
Created attachment 132410 [details] [review]
0001-Bug-578197-Handle-builtin-icons.patch
Comment 11 Brian Cameron 2009-04-09 20:05:26 UTC
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.

Comment 12 Colin Walters 2009-04-15 17:27:31 UTC
Created attachment 132716 [details] [review]
rebased to master
Comment 13 Milan Bouchet-Valat 2009-05-05 21:30:09 UTC
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... ;-)
Comment 14 Milan Bouchet-Valat 2009-05-05 21:30:49 UTC
*** Bug 578041 has been marked as a duplicate of this bug. ***
Comment 15 Owen Taylor 2009-07-07 11:10:26 UTC
*** Bug 587888 has been marked as a duplicate of this bug. ***
Comment 16 Owen Taylor 2009-07-07 11:22:13 UTC
Needs to be redone in the ShellTextureCache C code.

(NO_SVG is not used by ShellTextureCache, so that has already been fixed.)
Comment 17 Colin Walters 2009-08-02 06:50:59 UTC
This one I fixed on the side in bug 590493

*** This bug has been marked as a duplicate of 590493 ***