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 629852 - Missing cursor causes crash?
Missing cursor causes crash?
Status: RESOLVED FIXED
Product: java-gnome
Classification: Bindings
Component: GTK
4.0.x
Other Cygwin
: Normal critical
: ---
Assigned To: Andrew Cowie
java-gnome bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-16 13:58 UTC by Yaakov Selkowitz
Modified: 2011-04-14 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Yaakov Selkowitz 2010-09-16 13:58:08 UTC
With Cygwin Ports' jamvm/classpath combo, java-gnome-4.0.16, and gnome-split-0.9:

UncaughtException in thread: main
  Thread ID      = 1
  Thread prority = 5
Exception stacktrace:
java.lang.ExceptionInInitializerError
   at org.gnome.split.gtk.MainWindow.setCursorWorkingState(MainWindow.java:369)
   at org.gnome.split.gtk.DefaultEngineListener.engineReady(DefaultEngineListener.java:210)
   at org.gnome.split.gtk.DefaultEngineListener.<init>(DefaultEngineListener.java:97)
   at org.gnome.split.GnomeSplit.<init>(GnomeSplit.java:145)
   at org.gnome.split.GnomeSplit.main(GnomeSplit.java:280)
Caused by: java.lang.RuntimeException: Cannot make a Java proxy for the NULL pointer!
   at org.freedesktop.bindings.Pointer.<init>(Pointer.java:72)
   at org.gnome.glib.Boxed.<init>(Boxed.java:67)
   at org.gnome.gdk.Cursor.<init>(Cursor.java:112)
   at org.gnome.gdk.Cursor.<clinit>(Cursor.java:161)
   at org.gnome.split.gtk.MainWindow.setCursorWorkingState(MainWindow.java:369)
   ...4 more

Note that slashtime is working just fine.
Comment 1 Andrew Cowie 2010-09-16 23:55:28 UTC
Interesting. The problem is that Cursor is trying to initialize the convenience Cursor.WORKING; for that one we use a named cursor rather than a CursorType constant; gdk_cursor_new_from_name() returns NULL if the name isn't found, but since that's a constructor to us the safety logic blows up (yeay!) because you can't create a Pointer object to 0x0....

This is only a problem if you don't have the "left_ptr_watch" named cursor in your cursor theme. I don't know why you wouldn't, but obviously you don't, and we should probably be robust against such a case.

There's no workaround, sorry.

As for fixing the problem: it's not clear to me why your cursor theme would be lacking this named cursor (aren't there standards for these things?) but we can change the code to initialize that constant to Java null if it's not found. Is that acceptable? Not sure.

AfC
Comment 2 Yaakov Selkowitz 2010-09-17 01:22:30 UTC
Hmmm.  I just use the default cursor (which is a libXfont builtin of font-cursor-misc), which indeed does not contain a left_ptr_watch glyph[1].  If I set Xcursor.theme (in .Xdefaults) or gtk-cursor-theme-name (in .gtkrc-2.0), then the selected theme appears in gnome-split's main window only; gnome-split's other windows (help, preferences) and other GTK+ programs still use the default cursor.

It sure seems that gnome-split is doing something unique here, although java-gnome  really shouldn't crash due to the default cursor.


[1] http://cgit.freedesktop.org/xorg/font/cursor-misc/tree/cursor.bdf
Comment 3 Andrew Cowie 2010-09-17 08:30:26 UTC
(In reply to comment #2)
> It sure seems that gnome-split is doing something unique here, although
> java-gnome  really shouldn't crash due to the default cursor.

It's not crashing due to the default cursor (which we make available as Cursor.NORMAL and is CursorType.LEFT_PTR), it's crashing because a commonly used cursor that everyone else seems to have (which we make available as Cursor.WORKING which is [1] actually named cursor "left_ptr_watch") is not in your cursor theme(s). We load 5 cursors when initializing [org.gnome.gdk] Cursor, and you are crashing because of one of them.

[1] http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gdk/Cursor.html#WORKING

Anyway, I've got a fix, pending discussion on the java-gnome-hackers mailing list.

AfC
Comment 4 Andrew Cowie 2010-09-18 10:45:44 UTC
Patch merged to 'mainline'. Cursor.WORKING should now be null for you.

AfC