Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1505 by [email protected]: X IO Error : Using g_idle_add_full inside ibus_im_context_focus_in instead of gdk_threads_add_idle_full
http://code.google.com/p/ibus/issues/detail?id=1505


What version of the product are you using? On what operating system?
OS (Linux distributions, UNIX or ...): Ubuntu 12.04
Architecture (i386, x86_64): x86_64
IBus version: 1.4, trunk
Input method name and version: any
Python version: none
dbus version: <unknown>
dbus-python version: <unknown>
gtk version (if bug is about gtk applications): 2.24
qt version (if bug is about qt applications): none

What steps will reproduce the problem?
Not sure, we couldn't reproduce it ourselves. A client is getting X IO errors "randomly". We got him to put a breakpoint on the X IO error handler, got the backtrace below, and then read the code and found the bug.

What is the expected output? What do you see instead?

Please provide any additional information below.
=============================
ibus_im_context_focus_in in ibus / client / gtk2 / ibusimcontext.c uses g_idle_add_full with a callback that callGDK functions, so it call them without the GDK lock.

It should use instead gdk_threads_add_idle_full to make the callback run with a lock.

Got broken by this commit
https://github.com/ibus/ibus/commit/279ee5d5b3697b427cc22cd99a55f4e611318e25#client/gtk2/ibusimcontext.c

Broken in 1.4, still ok in 1.3.

We found it on Ubuntu 12.04.

========    backtrace

Breakpoint 1, 0x00000040000b6094 in ?? ()
(gdb) where
#0  0x00000040000b6094 in ?? ()
#1  0x00007ffff569841e in _XIOError ()
   from /usr/lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007ffff569638b in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#3  0x00007ffff5693407 in XTranslateCoordinates ()
   from /usr/lib/x86_64-linux-gnu/libX11.so.6
#4  0x00007ffff5c02b2d in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#5  0x00007fffd8968caf in ?? ()
   from /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-ibus.so
#6  0x00007ffff6910d53 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff69110a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007ffff691149a in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00000040000503ca in ?? ()
#10 0x0000000000000000 in ?? ()




--
You received this message because you are subscribed to the Google
Groups "ibus-devel" group.
iBus project web page: http://code.google.com/p/ibus/
iBus dev group: http://groups.google.com/group/ibus-devel?hl=en

回复