Re: Rhythmbox segfault



On Fri, 2004-04-02 at 09:23, Matt Rose wrote:
> I know I should probably send this to the rhytmbox users list, but I 
> wanted to see if there was somebody here who knew what caused this 
> segfault
> 

<snip>

>  
> Thread 1 (Thread 1088866816 (LWP 2687)):
> #0  0x40cb4268 in strcmp () from /lib/tls/libc.so.6
> #1  0x0806931a in rb_statusbar_sync_state (statusbar=0x82a5f78)
>     at rb-statusbar.c:535

strcmp() causing a segfault.  Hilarious.

In rhythmbox-0.7.0 rb-statusbar.c line 535 shows

    gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (statusbar->priv->shuffle),
                        !is_linear && !is_shuffle);

Is this what your code has?

Anyways,  I'm _guessing_ the problem is

    g_object_get (G_OBJECT (statusbar->priv->player),
              "play-order", &play_order,
              "repeat", &repeat,
              NULL);
                                                                                                                                               
    is_linear = (strcmp (play_order, "linear") == 0);
    is_shuffle = (strcmp (play_order, "shuffle") == 0);

The code doesn't check if play_order is NULL before calling strcmp(). 
Thats probably what is causing the segfault.

Perhaps something like

    if( play_order == NULL ) {
        is_linear = is_shuffle = 0;
    }
    else {
        is_linear = (strcmp (play_order, "linear") == 0);
        is_shuffle = (strcmp (play_order, "shuffle") == 0);
    }

Would fix the problem.

Mike




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]