XIM application crashes on gtk+1.3.*



I'm seeing yet another problem described below when I input Japanese text
via XIM input module on another sample program, examples/entry/entry.c
distrubuted with gtk+.

Note that I modified the C program to call gtk_set_locale() just before
gtk_init(), and compiled it with gtk-config-2.0 as follows:

  gcc `gtk-config-2.0 --cflags`  entry.c -o entry `gtk-config-2.0 --libs`

This happens on both 1.3.2 tarball and the latest out of cvs.

-toshi
-------

Operating System:
	Redhat Linux 6.2J on intel PC
Language:
	Japanese
Problem Summary:
	gtk/examples/entry/entry crashes when the preedit text gets
	converted
Which feature or component were you using?
	XIM input module in gtk+/module/input
How serious is the problem?
	Critical, causing the application to crash
Does the problem happen consistently?
	Yes, always
What are the steps to reproduce the problem?

	Run "entry" program in gtk+/examples/entry with LANG=ja_JP.eucJP
	on Redhat 6.2J. The program should automatically use kinput2 XIM
	server by default. Then, with the steps below, the application
	crashes.
	
	 1. hit "Shift-space" to start Japanese input.
	 2. type any text, e.g. "aiu".
	 3. hit SPACE key, then the application crashes, but it
	    should convert the text, instead.
	    On kterm, the same steps convert the preedit text properly.
Stack Trace:
   
(gdb) where 10
#0  0xff0ad5c0 in gdk_region_copy () from /opt/gnome2/lib//libgdk-x11-1.3.so.2
#1  0xff0c54c4 in gdk_gc_copy () from /opt/gnome2/lib//libgdk-x11-1.3.so.2
#2  0xff0a3cac in gdk_pango_get_gc () from /opt/gnome2/lib//libgdk-x11-1.3.so.2
#3  0xff0a3ffc in gdk_draw_layout_line ()
   from /opt/gnome2/lib//libgdk-x11-1.3.so.2
#4  0xff0a43ec in gdk_draw_layout () from /opt/gnome2/lib//libgdk-x11-1.3.so.2
#5  0xff1a1504 in gtk_entry_draw_text ()
   from /opt/gnome2/lib//libgtk-x11-1.3.so.2
#6  0xff19f834 in gtk_entry_expose () from /opt/gnome2/lib//libgtk-x11-1.3.so.2
#7  0xff21bf68 in gtk_marshal_BOOLEAN__POINTER ()
   from /opt/gnome2/lib//libgtk-x11-1.3.so.2
#8  0xff0591ac in g_type_class_meta_marshal ()
   from /opt/gnome2/lib//libgobject-1.3.so.2
#9  0xff058e80 in g_closure_invoke () from /opt/gnome2/lib//libgobject-1.3.so.2

A code Hack to avoid the problem:

  A patch is in the attachment to avoid NULL GdkRegion being copied
  in gdk_region_copy(). It would be a better patch to avoid passing NULL
  GdkRegion to gdk_region_copy().
? temp
Index: gdkregion-generic.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkregion-generic.c,v
retrieving revision 1.6
diff -u -r1.6 gdkregion-generic.c
--- gdkregion-generic.c	2000/11/28 18:45:03	1.6
+++ gdkregion-generic.c	2000/12/01 03:13:01
@@ -149,6 +149,8 @@
 {
   GdkRegion *temp;
 
+  if (!region) return (GdkRegion*)NULL;
+
   temp = g_new (GdkRegion, 1);
   temp->rects = g_new (GdkRegionBox, region->numRects);
 


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