GNOME Bugzilla – Bug 311599
gnome-mouse-properties crash at startup
Last modified: 2005-08-01 15:59:30 UTC
Distribution/Version: Gentoo 1. click on the icon in menu 2. wait one seconde 3. see bugbuddy starting to report the crash :-)
Debugging Information: Backtrace was generated from '/home/test/prefix/bin/gnome-mouse-properties' Using host libthread_db library "/lib/tls/libthread_db.so.1". `system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols. 0xffffe410 in __kernel_vsyscall ()
+ Trace 61996
not seeing this in CVS HEAD compiled July 19th. Stack trace is unique however so marking new and changing version to 2.11.x.
Updated CVS version of GTK+ and gnome-control-version today... crash remain !
Thanks for your bug. What is the value of the ""/desktop/gnome/peripherals/mouse/cursor_theme" gconf key? Are you sure than gnome-mouse-properties.glade is correctly installed and uptodate?
gconf key is "<no value>" and I have the file: -rw-r--r-- 1 test users 48207 jui 27 10:21 share/control-center-2.0/interfaces/gnome-mouse-properties.glade in my prefix folder (compiled with jhbuild).
It crashes if you have no cursor theme available. Maybe you can try to install cursor theme and note if that fixes the issue?
ok ! I installed some themes in ~/.icons and now it works (without change gconf key). I'll try to look at code to find what is appening when no theme are found :)
Created attachment 50018 [details] [review] it works with it The bug was trivial. gtk_tree_model_get_iter_root(model, &iter) returns FALSE if the list is empty and then iter is invalide.
i would propose to use add g_return_if_fail() in this case, not another level of indenting, this way we would echo the error into stdout and don't need too nested code. can you agree on this, xavier?
This change fixes the issue: --- gnome-mouse-properties.c 31 Jul 2005 12:58:41 -0000 1.56 +++ gnome-mouse-properties.c 1 Aug 2005 12:34:39 -0000 @@ -472,9 +472,9 @@ GtkTreeModel * smodel = gtk_tree_view_get_model(view); GtkTreeModel * model = gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(smodel)); gchar * theme = gconf_client_get_string (client, CURSOR_THEME_KEY, NULL); - gtk_tree_model_get_iter_root(model, &iter); gint size = gconf_client_get_int (client, CURSOR_SIZE_KEY, NULL); - gtk_tree_model_get_iter_root(model, &iter); + + g_return_if_fail (gtk_tree_model_get_iter_first (model, &iter)); do { gchar* theme_name; Sven, any reason to use 2 times the get_iter here? I've replaced the function by get_iter_first ()
no reason, i guess this happened by manual coding and copy'n'paste.
thanks for the patch, marking as needs-work according to the previous comment
I've fixed this with the changes described by comment #10: 2005-08-01 Sebastien Bacher <seb128@debian.org> * gnome-mouse-properties.c: (cursor_theme_changed): don't crash if there is no cursor theme installed (Closes: #311599).
i'm not sure, but I think it can make a memory leak. gchar *theme isn't freed (last line). I think it's possible that no theme are installed but gconf's key isn't empty ! if I manualy change it for example. If i'm wrong sorry for the reopen :-)
fixed: 2005-08-01 Sebastien Bacher <seb128@debian.org> * gnome-mouse-properties.c: (cursor_theme_changed): no need to allocate a string for the theme when there is no theme installed.