GTK Bug with visuals



Hello everyone, my first mailing, so tell me if this isn't the place to send
bug reports, or the format is incorrect.

At any rate, in running testgtk on a bw screen (yes, there ARE those still
out there ;-), I kept getting coredumps due to segmentation violations. I've
traced it down to several uses of visuals that were being dereferenced, even
though they were NULL. Changed gtk to fix the problem, and suddenly it was 
still
getting segv signals, though not writing core's anymore (and try to find out
from where that signal was thrown without a core. FUN i tell you). Finally
got it to write cores again, and fixed several other dereferences on visuals
until testgtk finally worked properly. Diffs below. have fun and bye
   Deon Ramsey


-----------------------------------------------------------------------------

Deon Ramsey (general Librarygopher) may be reached as:
Work:                       Private:
dfkidok@dfki.uni-kl.de      ramsey@rhrk.uni-kl.de

WWW:
<A HREF="http://www.dfki.uni-kl.de/~ramsey/">Deon Ramsey</A>

Or via Snail-Mail:          Deon Ramsey
                            Koenigstr. 11
                            67655 Kaiserslautern
                            Germany

Program (Pro'-gram) n. A magic spell cast over a computer, causing it to
turn one's input into error messages.

There are many intelligent species in the Universe.
                                             They are all owned by cats.

Be discreet, be polite, but be yourself. -- Per Aspera


diff -u -r gtk+-0.99.4/gdk/gdk.c gtk+-0.99.4-new/gdk/gdk.c
--- gtk+-0.99.4/gdk/gdk.c	Mon Mar  2 00:15:22 1998
+++ gtk+-0.99.4-new/gdk/gdk.c	Mon Mar  2 20:57:51 1998
@@ -3114,7 +3114,11 @@
     }
 
   g_print ("\n** ERROR **: %s caught\n", sig);
+#ifdef G_ENABLE_DEBUG
+  abort();
+#else
   gdk_exit (1);
+#endif
 }
 
 static void
diff -u -r gtk+-0.99.4/gtk/gtkpreview.c gtk+-0.99.4-new/gtk/gtkpreview.c
--- gtk+-0.99.4/gtk/gtkpreview.c	Sun Mar  1 21:19:27 1998
+++ gtk+-0.99.4-new/gtk/gtkpreview.c	Mon Mar  2 20:40:40 1998
@@ -222,7 +222,7 @@
   GtkPreviewProp *prop;
   GdkAtom property;
 
-  if (preview_class && !install_cmap &&
+  if (preview_class && !install_cmap && preview_class->info.visual &&
       (preview_class->info.visual->type != GDK_VISUAL_TRUE_COLOR) &&
       (preview_class->info.visual->type != GDK_VISUAL_DIRECT_COLOR))
     {
@@ -489,6 +489,7 @@
   g_return_if_fail (preview != NULL);
   g_return_if_fail (GTK_IS_PREVIEW (preview));
   g_return_if_fail (data != NULL);
+  g_return_if_fail (preview_class->info.visual != NULL);
 
   if ((w <= 0) || (y < 0))
     return;
@@ -934,7 +935,7 @@
     { 63, 31, 55, 23, 61, 29, 53, 21 }
   };
 
-  if (klass->info.visual->type != GDK_VISUAL_PSEUDO_COLOR)
+  if (!(klass->info.visual) || (klass->info.visual->type != 
GDK_VISUAL_PSEUDO_COLOR))
     return;
 
   shades_r = klass->info.nred_shades;




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