Re: Problems with gtk+ 1.1.6




Mario Motta <mmotta@guest.net> writes:

> hi all,
> Weird problems using gtk+ 1.1.6:
> - Compilation and installing was flawless, but
> running testgtk i got: can't open display() 0:0
> - Tried to patch testgtk to avoid loading and and parsing rc file then i
> got: "GLIB:warning could'nt allocate 8192 bytes" and programs crashes
> miserably.
> - Also just simple helloworld, shows same behaviour:
> GLIB: "GLIB:warning could'nt allocate 8192 bytes" and crashes
> With a little debug i discovered two strange things:
> - both helloworld and testgtk crash because g_malloc() exausted
> available memory

I believe all of these may be symptoms of one memory allocation
problem which was introduced a few hours before the release and
removed a few hours afterwords.

You can try the patch below which is now in CVS.

> - testgtk executable is 3 Kb in size (too much thin i believe)
> No others gtk+ version are installed, i completely remove previous gtk+
> 1.1.5.

try 'more testgtk' It's just a wrapper shell script.

Regards,
                                        Owen

Index: gtkrc.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrc.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- gtkrc.c	1998/12/09 01:05:39	1.29
+++ gtkrc.c	1998/12/09 05:43:35	1.30
@@ -336,12 +336,12 @@
     }
   else
     {
-      str = g_malloc (strlen(GTK_SYSCONFDIR) + strlen("/gtkrc"));
+      str = g_malloc (strlen(GTK_SYSCONFDIR) + strlen("/gtkrc") + 1);
       sprintf (str, "%s%s", GTK_SYSCONFDIR, "/gtkrc");
       gtk_rc_add_default_file (str);
 
       var = g_get_home_dir ();
-      str = g_malloc (strlen(var) + strlen("/.gtkrc"));
+      str = g_malloc (strlen(var) + strlen("/.gtkrc") + 1);
       sprintf (str, "%s%s", var, "/.gtkrc");
       gtk_rc_add_default_file (str);
     }



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