Bug 44881 - xcin xim windowmanager hangs
Summary: xcin xim windowmanager hangs
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: LO crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 62643 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-07-08 14:48 UTC by wentland
Modified: 2003-08-14 11:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
a patch for one from KDE_3_0_1_RELEASE to KDE_3_0_5A_RELEASE (945 bytes, patch)
2003-01-23 13:25 UTC, OGINO Tomonori
Details
a patch for KDE_3_1_0_RELEASE (933 bytes, patch)
2003-01-23 13:35 UTC, OGINO Tomonori
Details
Here is a new patch for -rHEAD. (1.77 KB, patch)
2003-01-23 21:40 UTC, OGINO Tomonori
Details
another patch for -rHEAD (3.27 KB, patch)
2003-01-24 12:34 UTC, OGINO Tomonori
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wentland 2002-07-08 14:43:22 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kwin
Version:           KDE 3.0.1 
Severity:          crash
Installed from:    SuSE RPMs
Compiler:          gcc 2.95.3
OS:                Linux
OS/Compiler notes: SuSe 8.0 Xfree 4.0

I`ve installed xim with xcin. When i start it within a xterm everything is fine but after adding: 
LANG=zh_CN LC_ALL=zh_CN xcin &
to .xim 
and:
export XMODIFIERS="@im=xcin-zh_CN"
export LC_CTYPE=zh_CN
to .profiles
the windowmanager chrashes when i try to resize or move the window! 

in /var/log/messages:
kdm[854]: Server for display :0 terminated unexpectedly
i`m using nvidia_glx as X-Server

If there are any questions left or you need more Information contact me.

thnxs
Wolodja


(Submitted via bugs.kde.org)
Comment 1 Lubos Lunak 2002-12-17 18:05:47 UTC
 The message 'Server for display :0 terminated unexpectedly' means that the XServer crashes, 
so it's most probably not a KDE problem. 
 
Comment 2 OGINO Tomonori 2003-01-21 18:49:29 UTC
Not all the same as Reporter, but I face on the similar problem.

Bug Process:
export LANG=ja_JP.eucJP #<- set locale Japanese-EUC
export XMODIFIERS="@im=kinput2"  #<- set XIM as kinput2.
kinput2 -canna & #<-launch kinput2
kdeinit 
kdeinit_wrapper kwin

.....and then Move or Resize Window get cause deadlock of  XGrabServer() at
"void Client::startMoveResize()" in kwin/client.cpp with "Options::Transparent".
"Options::Opaque" dont call XGrabServer() not to cause deadlock. 

These XGrabServer() codes was added  at -r1.2.
Ludos, you need those XGrabServer() ? or  get it away. 

Here is the patch for CVS.
<-------------------------------------------begin
RCS file: /home/kde/kdebase/kwin/client.cpp,v
retrieving revision 1.344
diff -u -3 -p -r1.344 client.cpp
--- client.cpp  10 Jan 2003 12:39:27 -0000      1.344
+++ client.cpp  21 Jan 2003 17:32:06 -0000
@@ -651,16 +651,10 @@ void Client::startMoveResize()
     workspace()->setClientIsMoving(this);
     grabMouse( cursor() );
     grabKeyboard();
-    if ( ( isMove() && options->moveMode != Options::Opaque )
-      || ( isResize() && options->resizeMode != Options::Opaque ) )
-        XGrabServer( qt_xdisplay() );
 }
 
 void Client::stopMoveResize()
 {
-    if ( ( isMove() && options->moveMode != Options::Opaque )
-      || ( isResize() && options->resizeMode != Options::Opaque ) )
-        XUngrabServer( qt_xdisplay() );
     releaseKeyboard();
     releaseMouse();
     workspace()->setClientIsMoving(0);
<--------------------------------------------------end

Listed below is backtrace on deadlock.

Kwin backtrace of dead-lock
#0  0x420d3b2e in select () from /lib/i686/libc.so.6
#1  0x40e77b28 in _XlcPublicMethods () from /usr/X11R6/lib/libX11.so.6
#2  0x40dce047 in _XRead () from /usr/X11R6/lib/libX11.so.6
#3  0x40dcdcab in _XReadEvents () from /usr/X11R6/lib/libX11.so.6
#4  0x40db9412 in XIfEvent () from /usr/X11R6/lib/libX11.so.6
#5  0x41fedaa1 in _XimThaiCloseIM ()
   from /usr/X11R6/lib/X11/locale/common/ximcp.so.2
#6  0x41feddc0 in _XimWrite () from /usr/X11R6/lib/X11/locale/common/ximcp.so.2
#7  0x41fee04a in _XimRead () from /usr/X11R6/lib/X11/locale/common/ximcp.so.2
#8  0x41fdb383 in _XimProtoCreateIC ()
   from /usr/X11R6/lib/X11/locale/common/ximcp.so.2
#9  0x40de88f4 in XCreateIC () from /usr/X11R6/lib/libX11.so.6
#10 0x4066f5fb in QInputContext (this=0x80e25b0, widget=0x81048e8)
    at kernel/qinputcontext_x11.cpp:334
#11 0x40692a6f in QWidget::createInputContext() (this=0x81048e8)
    at kernel/qwidget_x11.cpp:2498
#12 0x40652b7f in QApplication::x11ProcessEvent(_XEvent*) (this=0xbffff940, 
    event=0xbffff7d0) at kernel/qapplication_x11.cpp:3431
#13 0x4066d40a in QEventLoop::processEvents(unsigned) (this=0x80bb700, flags=4)
    at kernel/qeventloop_x11.cpp:169
#14 0x406ddbe2 in QEventLoop::enterLoop() (this=0x80bb700)
    at kernel/qeventloop.cpp:191
#15 0x406ddafe in QEventLoop::exec() (this=0x80bb700)
    at kernel/qeventloop.cpp:138
#16 0x406c3c49 in QApplication::exec() (this=0xbffff940)
    at kernel/qapplication.cpp:2471
#17 0x40071487 in kdemain (argc=1, argv=0xbffffb04) at main.cpp:277
#18 0x0804854b in main (c=-514, v=0xfffffdfe) at kwin_main.cpp:5
#19 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6

kinput2 backtrace of deadlock
#0  0x420d3b2e in select () from /lib/i686/libc.so.6
#1  0x402ddb28 in _XlcPublicMethods () from /usr/X11R6/lib/libX11.so.6
#2  0x40234047 in _XRead () from /usr/X11R6/lib/libX11.so.6
#3  0x40234b67 in _XReply () from /usr/X11R6/lib/libX11.so.6
#4  0x4021e522 in XGetWindowProperty () from /usr/X11R6/lib/libX11.so.6
#5  0x08073c29 in xinput ()
#6  0x0805d691 in doDispatch ()
#7  0x0805d709 in MyDispatchEvent ()
#8  0x0804bde1 in main ()
#9  0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
Comment 3 OGINO Tomonori 2003-01-23 13:25:06 UTC
Created attachment 792 [details]
a patch for one from KDE_3_0_1_RELEASE to KDE_3_0_5A_RELEASE
Comment 4 OGINO Tomonori 2003-01-23 13:35:45 UTC
Created attachment 793 [details]
a patch for KDE_3_1_0_RELEASE
Comment 5 Lubos Lunak 2003-01-23 14:43:50 UTC
 Sorry, the patches are wrong, the calls to XGrabServer() are there for a reason. The right fix 
needs to go elsewhere. For now, simply use the Opaque modes as a workaround. 
 
Comment 6 OGINO Tomonori 2003-01-23 16:50:19 UTC
Ok, I know.
But "qt-mt.so" don't allow that.
We need the more grained-calls to XGrabServer().
Comment 7 OGINO Tomonori 2003-01-23 21:40:27 UTC
Created attachment 797 [details]
Here is a new patch for -rHEAD.

On move and resize, filter out "FocusIn" events that invoke
QWidget::createInputContext().
Comment 8 OGINO Tomonori 2003-01-24 12:04:36 UTC
Bug 43243: KDE freeze when resize
Bug 43602: hung up kwin move/resize window when don't display content
Bug 43793: Hang up during Resize

These fixed will be the same bugs.
Comment 9 OGINO Tomonori 2003-01-24 12:34:28 UTC
Created attachment 800 [details]
another patch for -rHEAD

an another branch of patch.
In client.cpp, catch all the calls to XGrabServer() and toggle a flag.
In workspace.cpp, check the flags and filter out "FocusIn" events when any
clients are XGrabServer()-ed.
Comment 10 Alger Hoi 2003-04-29 12:48:21 UTC
I still get the same problem in using KDE 3.1.1 and xcin in my FreeBSD box. KDE
hang if you have the opions "display window content during moment and resize"
disabled and use xcin2.5 together. 

The problem does not exist if the options "display window content during window
moment and resize" is on.
Comment 11 Lubos Lunak 2003-06-11 10:50:20 UTC
I've changed KWin in CVS HEAD to filter out all FocusIn/FocusOut events that Qt could get, so 
that should fix the problem. However, since I'm not sure what all things this could possibly 
affect, I decided not to backport this change. For KDE3.1, you'll have to stick to using Opaque 
moving, sorry. 
 
Comment 12 Lubos Lunak 2003-08-14 11:28:56 UTC
*** Bug 62643 has been marked as a duplicate of this bug. ***
Comment 13 Lubos Lunak 2003-08-14 11:29:38 UTC
I backported the fix for KDE-3.1.4 .