Bug 627107

Summary: While using firefox, many ibus-xkb zombie processes gernerate.
Product: [Fedora] Fedora Reporter: sangu <sangu.fedora>
Component: ibusAssignee: fujiwara <tfujiwar>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: i18n-bugs, shawn.p.huang, tfujiwar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-28 01:21:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sangu 2010-08-25 06:18:25 UTC
Description of problem:
$ ps ax
[skip]
17290 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17291 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17293 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17298 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17299 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17316 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17317 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17322 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17323 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17325 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17328 pts/0    Z+     0:00 [ibus-xkb] <defunct>
17329 pts/0    Z+     0:00 [ibus-xkb] <defunct


Version-Release number of selected component (if applicable):
1.3.7-1.fc14

How reproducible:
always

Steps to Reproduce:
1.  firefox starts
2. Input a web site in url bar
3. create tab
4. Input a web site in url bar  
Actual results:


Expected results:


Additional info:
ibus-1.3.7-1.fc14.x86_64
ibus-hangul-1.3.0.20100329-3.fc14.x86_64
libuser-python-0.56.16-3.fc14.x86_64
libusb-0.1.12-23.fc14.x86_64
ibus-gtk3-1.3.7-1.fc14.x86_64
libuser-0.56.16-3.fc14.x86_64
ibus-libs-1.3.7-1.fc14.x86_64
ibus-gtk2-1.3.7-1.fc14.x86_64
ibus-anthy-1.2.1-2.fc14.x86_64

Comment 1 fujiwara 2010-08-25 07:48:27 UTC
(In reply to comment #0)
> 17290 pts/0    Z+     0:00 [ibus-xkb] <defunct>

From your log, I guess you run ibus-daemon with command line.

How do you run ibus-daemon?
ibus-daemon calls ibus panel. ibus panel calls ibus-xkb.
/usr/bin/ibus-daemon --xim
 + env IBUS_PREFIX=/usr python /usr/share/ibus/ui/gtk/main.py
   + /usr/libexec/ibus-xkb --get

ibus-xkb needs DISPLAY permission. Probably I think if you run ibus-daemon with proper $DISPLAY, your ibus-xkb would not be zombie?
Does your ibus-xkb work with command line?
% /usr/libexec/ibus-xkb --help
% /usr/libexec/ibus-xkb --get

Comment 2 fujiwara 2010-08-26 03:53:07 UTC
OK, if I run a sample program, I could reproduce this bug while I could not see the same problem when xkblayout is run under ibus panel.

$ cat a.py 
#!/usr/bin/python

import ibus
from ibus.xkblayout import XKBLayout

bus = ibus.Bus()
config = bus.get_config()
xkblayout = XKBLayout(config)
xkblayout.set_layout()

I think get_layout() is no problem.
set_layout() needs to use os.waitpid() to avoid zombie.

Comment 3 fujiwara 2010-08-26 04:28:53 UTC
Modifying /usr/lib/python2.6/site-packages/ibus/xkblayout.py

--- a/ibus-541492-xkb.patch
+++ b/ibus-541492-xkb.patch
@@ -267,7 +267,7 @@ new file mode 100644
 index 0000000..b5f1a06
 --- /dev/null
 +++ b/ibus/xkblayout.py.in
-@@ -0,0 +1,86 @@
+@@ -0,0 +1,87 @@
 +# vim:set et sts=4 sw=4:
 +#
 +# ibus - The Input Bus
@@ -340,7 +340,8 @@ index 0000000..b5f1a06
 +        if need_us_layout:
 +            layout = layout + ",us"
 +        args.append(layout)
-+        os.spawnl(os.P_NOWAIT, *args)
++        pid = os.spawnl(os.P_NOWAIT, *args)
++        os.waitpid(pid, 0)
 +
 +    def set_default_layout(self, layout="default"):
 +        if self.__command == None:

Comment 4 Fedora Update System 2010-08-26 05:10:41 UTC
ibus-1.3.7-2.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/ibus-1.3.7-2.fc14

Comment 5 Fedora Update System 2010-08-26 18:35:30 UTC
ibus-1.3.7-2.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ibus'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/ibus-1.3.7-2.fc14

Comment 6 sangu 2010-08-28 01:21:13 UTC
Fixed in ibus-1.3.7-2.
Thanks!