asclock_applet from GNOME1.0.4 SEGVs on 8-bit display (Solaris) - WITH FIX!




The new asclock starts, draws a very simple clock-in-a-box then goes away again. 
 Checking the coredump I get:

Core was generated by `/usr/local/gnome/bin/asclock_applet'.
Program terminated with signal 11, Segmentation Fault.
(gdb) where
#0  0x17738 in get_pixel (x=1, y=9, r=0xffbeeb5c, g=0xffbeeb58, b=0xffbeeb54) at 
rot.c:49
#1  0x17cb4 in rotate (img=0x9, map=0x84370 "", center_x=30, center_y=24, 
rot_x=1, rot_y=2, alpha=-9.1522079787037036) at rot.c:164
#2  0x15008 in analog (my=0x37f00, p=0x83240, gc=0x39198, clk=0xfeaba610) at 
draw.c:22
#3  0x14810 in update_clock (data=0x37f00) at asclock.c:347
#4  0xff24662c in ?? () from /usr/local/lib/libglib-1.2.so.0
#5  0xff2452c4 in ?? () from /usr/local/lib/libglib-1.2.so.0
#6  0xff245b08 in ?? () from /usr/local/lib/libglib-1.2.so.0
#7  0xff245d18 in ?? () from /usr/local/lib/libglib-1.2.so.0
#8  0xfedbb83c in ?? () from /usr/local/lib/libgtk-1.2.so.0
#9  0xff377580 in ?? () from /usr/local/gnome/lib/libpanel_applet.so.0
#10 0x14f28 in main (argc=0, argv=0xffbef264) at asclock.c:601

static void get_pixel(int x, int y, int *r, int *g, int *b)
{
  guint32 pixel;

  pixel = gdk_image_get_pixel(act_img, x, y);

  if(visual_depth>=15) {
    *r = (pixel & visual->red_mask) >> visual->red_shift;
    *g = (pixel & visual->green_mask) >> visual->green_shift;
    *b = (pixel & visual->blue_mask) >> visual->blue_shift;
  }
  else {
>>  *r = cmap->colors[pixel].red / 256;
    *g = cmap->colors[pixel].green / 256;
    *b = cmap->colors[pixel].blue / 256;
  }
  
(gdb) print *cmap
$5 = {size = 105840660, colors = 0x4208}
(gdb) print cmap->colors[pixel].red
Cannot access memory at address 0x4758.

This is on an 8-bit display on Solaris 8_alpha19.

The fix, believe it or not is to comment out the duplicate reference to 
GdkColormap *cmap at the top of main() in asclock.c line 431, thus:

int main( int argc, char *argv[] )
{
    /* GtkWidget is the storage type for widgets */
    GdkWindowPrivate *clk;
    GdkColor colour;
!    /*GdkColormap *cmap;*/

Works for me.  Don't have CVS access though, sorry.

This then allows it to work, but I get another core when I try to open the 
Properties.  This one is:

Core was generated by `asclock_applet'.
Program terminated with signal 11, Segmentation Fault.
(gdb) where
#0  0xfea3ad9c in ?? () from /usr/lib/libc.so.1
#1  0x168d0 in properties_dialog (applet=0x23c00, data=0x37f10) at dialogs.c:280
#2  0xff377690 in ?? () from 
/apps/local/BUILD/gnome-core-1.0.4/applets/asclock/../../panel/.libs/libpanel_ap
plet.so.0
#3  0xff37c0ac in ?? () from 
/apps/local/BUILD/gnome-core-1.0.4/applets/asclock/../../panel/.libs/libpanel_ap
plet.so.0
#4  0xff2a92d8 in ?? () from /usr/local/gnome/lib/libORBit.so.0
#5  0xff2ab190 in ?? () from /usr/local/gnome/lib/libORBit.so.0
#6  0xff2ab444 in ?? () from /usr/local/gnome/lib/libORBit.so.0
#7  0xff3333cc in ?? () from /usr/local/gnome/lib/libIIOP.so.0
#8  0xff0b7c84 in ?? () from /usr/local/gnome/lib/libgnorba.so.27
#9  0xff2435d0 in ?? () from /usr/local/lib/libglib-1.2.so.0
#10 0xff2452c4 in ?? () from /usr/local/lib/libglib-1.2.so.0
#11 0xff245b08 in ?? () from /usr/local/lib/libglib-1.2.so.0
#12 0xff245d18 in ?? () from /usr/local/lib/libglib-1.2.so.0
#13 0xfedbb83c in ?? () from /usr/local/lib/libgtk-1.2.so.0
#14 0xff377580 in ?? () from 
/apps/local/BUILD/gnome-core-1.0.4/applets/asclock/../../panel/.libs/libpanel_ap
plet.so.0
#15 0x14f34 in main (argc=0, argv=0xffbef1dc) at asclock.c:601
(gdb) up
#1  0x168d0 in properties_dialog (applet=0x23c00, data=0x37f10) at dialogs.c:280

	    gchar *elems[2] = { filename, NULL };
	    strcpy(filename, *cpp);
	    strcat(filename, dp->d_name);
            gtk_clist_append(GTK_CLIST(list), elems );
      }
>>    closedir(dfd);
    }

  /* show ampm toggle button */
  label = gtk_check_button_new_with_label (_("Display time in 12 hour format 
(AM/PM)"));

(gdb) print *dfd
$1 = {dd_fd = 105840660, dd_loc = 16904, dd_size = 37905, dd_buf = 0xc350 
<Address 0xc350 out of bounds>}

This seems to be based on my default settings and where the themes_directory is, 
but I can't find any settings for that =O(

Sorry if this has been reported already.

-------My opinion - Not sane, intelligent or necessarily useful-------
o o                                      mailto:Moredhel@earthling.net 
/v\ark R. Bowyer.  http://i.am/Moredhel  mailto:Mark.Bowyer@UK.Sun.COM
`-'  "That weenie's avoiding me!" - Scott McNealy about i.am/BillZebub




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