GNOME Bugzilla – Bug 629852
Missing cursor causes crash?
Last modified: 2011-04-14 13:39:12 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.
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
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
(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
Patch merged to 'mainline'. Cursor.WORKING should now be null for you. AfC