Bug 3630

Summary: leafpad segfault when uim-xim executed
Product: UIM Reporter: TOKUNAGA Hiroyuki <tkng>
Component: bridge: XIMAssignee: uim-bugs
Status: CLOSED NOTABUG QA Contact:
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description TOKUNAGA Hiroyuki 2005-06-26 02:56:35 UTC
I'm not confident that this is the bug of uim for now...

Reproduce procedure is following.

1. export GTK_IM_MODULE=xim
2. gedit&
3. Right click upon the leafpad and switch the immodule to uim
4. Execute uim-xim

Then gedit suddenly disappear. If GTK_IM_MODULE is set to uim at first, there seems
no problem.
Comment 1 TOKUNAGA Hiroyuki 2005-06-26 03:00:35 UTC
I tested above procedure again, but replaced uim-xim with kinput2. There's no
problem.
I guess it must be a bug in uim.
Comment 2 TOKUNAGA Hiroyuki 2005-06-26 03:44:38 UTC
I deleted the lines related on uim from /etc/gtk-2.0/gtk.immodules, and tested
again.
Problem occured. Now I'm guessing it's a problem of uim-xim. Maybe it depends on
the 
version of GTK+. I'm using GTK+ 2.6.8.
Comment 3 Etsushi Kato 2005-06-26 04:55:14 UTC
It seems this is a bug in gtk+2.
I could reproduce the bug with both uim-xim and kintpu2.

I invoked following command without kinput2 process.

XMODIFIERS=@im=kinput2 GTK_IM_MODULE=xim leafpad &
kinput2 &

Then leafpad crashed.
Comment 4 Etsushi Kato 2005-06-26 05:05:03 UTC
Sorry about too many typo...  And previous post was insufficient to reproduce
the gtk+ bug.

Again here it the procedure.


without kinput2 process.
XMODIFIERS=@im=kinput2 GTK_IM_MODULE=xim leafpad &
Change input method context to uim in leafpad.
kinput2 &

Then leafpad crashed.
Comment 5 Etsushi Kato 2005-06-26 06:27:22 UTC
OK.  I found the bug in gtk.
Here is the fix for gtk+-2.6.7.

I'll post bugzilla of gtk+ RNS (I'm a bit buzy these days).

--- gtkimcontextxim.c.orig	2005-02-01 04:55:10.000000000 +0900
+++ gtkimcontextxim.c	2005-06-26 22:22:58.000000000 +0900
@@ -562,9 +562,22 @@
 gtk_im_context_xim_finalize (GObject *obj)
 {
   GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (obj);
+  GdkScreen *screen;
+  GdkDisplay *display;
 
   context_xim->finalizing = TRUE;
 
+  if (context_xim->im_info) {
+    screen = context_xim->im_info->screen;
+    display = gdk_screen_get_display (screen);
+    if (context_xim->im_info->reconnecting == TRUE) {
+      XUnregisterIMInstantiateCallback (GDK_DISPLAY_XDISPLAY(display),
+					NULL, NULL, NULL,
+					xim_instantiate_callback,
+					(XPointer)context_xim->im_info);
+    }
+  }
+
   set_ic_client_window (context_xim, NULL);
 
   g_free (context_xim->locale);
Comment 6 TOKUNAGA Hiroyuki 2005-06-26 11:50:49 UTC
You are right, I 've forgotten to change the value of XMODIFIERS to @im=kinput2.

It would be great if we could correspond to this bug in uim-xim, but
unfortunately it 
seems impossible or very difficult...

Anyway, thanks to your patch. I anticipate seeing your name in the release note of
GTK+ 2.6.9.
Comment 7 Etsushi Kato 2005-06-26 12:21:07 UTC
I submitted a bug report.
http://bugzilla.gnome.org/show_bug.cgi?id=309054

It is impossible to fix this in uim-xim side.
Comment 8 Etsushi Kato 2005-06-26 22:38:58 UTC
Tha patch has been applied on gtk+ CVS.
So close this bug.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.