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 109323 - crash start gnome-sound-properties
crash start gnome-sound-properties
Status: RESOLVED WONTFIX
Product: gnome-control-center
Classification: Core
Component: Sound
2.2.x
Other Linux
: High critical
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-03-27 12:30 UTC by alexhack
Modified: 2005-03-28 13:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.1/2.2


Attachments
patch (339 bytes, patch)
2003-03-27 12:32 UTC, alexhack
none Details | Review
prev to be patch.gz, this seample plain text (694 bytes, patch)
2003-03-27 12:35 UTC, alexhack
none Details | Review

Description alexhack 2003-03-27 12:30:33 UTC
Description of Problem:
Has updated a package control-center from version
2.2.0.1 up to 2.2.1. Then the program
gnome-sound-properties falls at start. Having
analysed distinctions and the debugging
information has written small patch which has
corrected this situation. Look please.

Steps to reproduce the problem:
1. update to version 2.2.1
2. run gnome-sound-properties => krash
3. 

Actual Results:


Expected Results:


How often does this happen? 


Additional Information:
Comment 1 alexhack 2003-03-27 12:32:36 UTC
Created attachment 15227 [details] [review]
patch
Comment 2 alexhack 2003-03-27 12:35:16 UTC
Created attachment 15228 [details] [review]
prev to be patch.gz, this seample plain text
Comment 3 Andrew Sobala 2003-03-27 17:45:13 UTC
Thanks for the bug report
Comment 4 Jonathan Blandford 2003-03-30 01:03:44 UTC
That patch leaks the values.  It should look more like:

  if (!str_a)
    cmp = 1;
  else if (!str_b)
    cmp = -1;
  else
    cmp = g_ascii_strcasecmp (str_a, str_b);
 	
  g_value_unset (&val_a);
  g_value_unset (&val_b);

  return cmp;
 }
etc...
Comment 5 Kjartan Maraas 2003-07-02 12:41:33 UTC
This is what the function looks like now. Does that mean this is wrong
too? I mean, it's callung g_value_unset() earlier than what's in the
comment above.

static gint
compare_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
gpointer data)
{
        GValue val_a = {0};
        GValue val_b = {0};
        gint cmp;
        const gchar *str_a, *str_b;
                                                                     
          
        gtk_tree_model_get_value (model, a, SORT_DATA_COLUMN, &val_a);
        str_a = g_value_get_string (&val_a);
        gtk_tree_model_get_value (model, b, SORT_DATA_COLUMN, &val_b);
        str_b = g_value_get_string (&val_b);
                                                                     
          
        cmp = g_ascii_strcasecmp (str_a, str_b);
                                                                     
          
        g_value_unset (&val_a);
        g_value_unset (&val_b);
                                                                     
          
        if (!str_a)
                return 1;
        else if (!str_b)
                return -1;
        else
                return cmp;
}
Comment 6 Jody Goldberg 2003-11-04 14:29:19 UTC
Memory wise the new code looks ok.  The main difference was the
handling of NULL.  g_ascii_strcasecmp will just g_warning on NULL if
either arg is NULL.  Which begs the question.  Why are we checking
NULL later ?

The code is also a smidge bogus in that a=NULL b=NULL will claim that
a > b

Can a or b == NULL ?
Comment 7 Sebastien Bacher 2005-01-06 13:11:29 UTC
any news on this ?