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 311599 - gnome-mouse-properties crash at startup
gnome-mouse-properties crash at startup
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Mouse
2.11.x
Other Linux
: High critical
: 2.12
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-07-26 14:24 UTC by Xavier Claessens
Modified: 2005-08-01 15:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
it works with it (2.16 KB, patch)
2005-07-31 15:36 UTC, Xavier Claessens
needs-work Details | Review

Description Xavier Claessens 2005-07-26 14:24:05 UTC
Distribution/Version: Gentoo

1. click on the icon in menu
2. wait one seconde
3. see bugbuddy starting to report the crash :-)
Comment 1 Xavier Claessens 2005-07-26 14:24:30 UTC
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 ()
  • #0 __kernel_vsyscall
  • #1 waitpid
    from /lib/tls/libpthread.so.0
  • #2 libgnomeui_segv_handle
    at gnome-ui-init.c line 749
  • #3 <signal handler called>
  • #4 IA__gtk_tree_model_get_valist
    at gtktreemodel.c line 1376
  • #5 IA__gtk_tree_model_get
    at gtktreemodel.c line 1338
  • #6 cursor_theme_changed
    at gnome-mouse-properties.c line 481
  • #7 main
    at gnome-mouse-properties.c line 925

Comment 2 Brent Smith (smitten) 2005-07-26 23:29:03 UTC
not seeing this in CVS HEAD compiled July 19th.

Stack trace is unique however so marking new and changing version to 2.11.x.
Comment 3 Xavier Claessens 2005-07-27 08:29:08 UTC
Updated CVS version of GTK+ and gnome-control-version today... crash remain !
Comment 4 Sebastien Bacher 2005-07-31 12:29:55 UTC
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?
Comment 5 Xavier Claessens 2005-07-31 14:08:38 UTC
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).
Comment 6 Sebastien Bacher 2005-07-31 14:40:18 UTC
It crashes if you have no cursor theme available. Maybe you can try to install
cursor theme and note if that fixes the issue?
Comment 7 Xavier Claessens 2005-07-31 15:03:43 UTC
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 :)
Comment 8 Xavier Claessens 2005-07-31 15:36:03 UTC
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.
Comment 9 Sven Herzberg 2005-08-01 12:10:09 UTC
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?
Comment 10 Sebastien Bacher 2005-08-01 12:36:22 UTC
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 () 
Comment 11 Sven Herzberg 2005-08-01 12:53:00 UTC
no reason, i guess this happened by manual coding and copy'n'paste.
Comment 12 Sebastien Bacher 2005-08-01 13:12:39 UTC
thanks for the patch, marking as needs-work according to the previous comment
Comment 13 Sebastien Bacher 2005-08-01 13:13:09 UTC
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).
Comment 14 Xavier Claessens 2005-08-01 15:46:12 UTC
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 :-)
Comment 15 Sebastien Bacher 2005-08-01 15:59:30 UTC
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.