Bug 143545 - KDE thinks Kile hangs
Summary: KDE thinks Kile hangs
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 137431 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-28 13:20 UTC by Maarten Th. Mulders
Modified: 2007-04-24 15:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kdebase/kwin/client.cpp patch (real fix) (559 bytes, patch)
2007-03-31 18:31 UTC, Modestas Vainius
Details
kdelibs/kdecore/netwm.cpp related fix. (617 bytes, patch)
2007-03-31 18:32 UTC, Modestas Vainius
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten Th. Mulders 2007-03-28 13:20:57 UTC
Version:           1.8.1 (using KDE 3.5.5, Kubuntu (edgy) 4:3.5.5-0ubuntu3.1)
Compiler:          Target: x86_64-linux-gnu
OS:                Linux (x86_64) release 2.6.17-11-generic

After having started Kile, I worked on my project. Then I QuickBuild it, and the DVI is displayed. When I press Alt+F4, the editor is shown. From this time on, KDE will sometimes popup with a message box:

Window with title "Document: /home/maarten/ba-thesis/proposal/proposal.tex - Kile" is not responding. This window belongs to application kile (PID=19765, hostname=localhost).
Do you wish to terminate this application? (All unsaved data in this application will be lost.)

But Kile isn't actually hanging.
Comment 1 Modestas Vainius 2007-03-31 09:40:26 UTC
Apparently, this bug is 64bit specific. More information here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416615
Comment 2 Modestas Vainius 2007-03-31 09:42:23 UTC
And it's not specific to kile. It's probably a kwin bug.
Comment 3 Modestas Vainius 2007-03-31 18:31:13 UTC
Created attachment 20138 [details]
kdebase/kwin/client.cpp patch (real fix)

Patch for kdebase/kwin/client.cpp fixing timestamp comparision on 64bit
systems. See NET::timestampCompare() docs for full explanation why simple != is
not enough
Comment 4 Modestas Vainius 2007-03-31 18:32:51 UTC
Created attachment 20139 [details]
kdelibs/kdecore/netwm.cpp related fix.

Related fix. Pass Xlib unwrapped xclient.window value to gotPing()
Comment 5 Thomas Braun 2007-04-01 12:30:15 UTC
Hello,

actually this sounds also exactly as s a known bug in kile 1.8.x.
Closing embedded viewers with ALT+F4, closes kile (sort of) and you get this strange error messages. You should close embedded viewers with ALT+E.

@Maarten Th. Mulders: Could you try version 1.9.x to verify if it is a kile problem.

Thanks
Comment 6 Modestas Vainius 2007-04-01 16:29:32 UTC
Comment on attachment 20139 [details]
kdelibs/kdecore/netwm.cpp related fix.

Sorry, this patch is invalid. Do not apply it. The other one is fine.
Comment 7 Modestas Vainius 2007-04-01 16:41:45 UTC
Re to comment #5:

The user is on amd64, i.e. 64bits arch. There is a generic problem (as of KDE 3.5 branch) on 64bit arches with such error message. Sorry for hijacking this bug if there is/was such a bug in kile too, but I believe kile is not at fault here.

To reproduce this with other apps, e.g. just open two tabs in konqueror and press X (close) or location->quit (alt+f4). A dialog box appears about multiple tabs. Then simply wait ~5 seconds and a similar "window is not responding" dialog box will appear asking whether to terminate the app or keeping it running.

This generic bug is not present on 32bit platforms, because Xlib assumes sizeof(long) == 4 that is true on 32bit, but false on 64bit arches. So such legacy stuff needs special care and workarounds on 64bit arches...

I really believe you should reassign this bug to kwin or ask a kwin maintainer to look at it... The patch is one-liner and simple (excluding a comment).
Comment 8 Maarten Th. Mulders 2007-04-02 09:40:01 UTC
How do I use version 1.9.x in Kubuntu? :$ Should I recompile Kile from source?
Comment 9 Thomas Braun 2007-04-02 20:45:27 UTC
Recompiling from source is probably the easiest method.

See http://kile.sourceforge.net/help.php#compile

@Modestas Vainius: As soon as I'm sure that there is no (additional) bug in kile, I will forward this bug to the kwin people. Thanks for your help :)

Thomas

Comment 10 Maarten Th. Mulders 2007-04-02 22:25:29 UTC
Version 1.9.3 (just compiled it myself) does have the same bug.
Comment 11 Thomas Braun 2007-04-10 21:55:31 UTC
Okay I can't reproduce the bug here on my 32bit install of debian on amd64 system.

Therefore I reassign the bug to kwin as proposed by Modestas Vainius in https://bugs.kde.org/show_bug.cgi?id=143545#c7.

Thanks kwin devs for looking at it.
Comment 12 Lubos Lunak 2007-04-11 16:41:46 UTC
SVN commit 652600 by lunakl:

Fix timestamp handling on 64bit platforms.
BUG: 143545



 M  +2 -1      client.cpp  


--- branches/KDE/3.5/kdebase/kwin/client.cpp #652599:652600
@@ -1108,7 +1108,8 @@
 
 void Client::gotPing( Time timestamp )
     {
-    if( timestamp != ping_timestamp )
+    // just plain compare is not good enough because of 64bit and truncating and whatnot
+    if( NET::timestampCompare( timestamp, ping_timestamp ) != 0 )
         return;
     delete ping_timer;
     ping_timer = NULL;
Comment 13 Lubos Lunak 2007-04-24 14:58:36 UTC
*** Bug 137431 has been marked as a duplicate of this bug. ***
Comment 14 Maarten Th. Mulders 2007-04-24 15:00:29 UTC
With the new release of Kubuntu 7.04, the problem has gone.