Bug 139025 - kwrited outputs debugging info on stdout which prevents getting output from other apps
Summary: kwrited outputs debugging info on stdout which prevents getting output from o...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Unclassified
Component: kwrited (show other bugs)
Version: unspecified
Platform: Ubuntu Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Robert Knight
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 21:26 UTC by Krzysztof Lichota
Modified: 2008-10-21 15:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Updated binaries for kwrited which fix this bug. (60.32 KB, application/x-tgz)
2006-12-19 23:51 UTC, Robert Knight
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Lichota 2006-12-19 21:26:17 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Ubuntu Packages

KWrited uses puts() to output debugging information what device it is listening on. See http://lxr.kde.org/source/KDE/kdebase/konsole/konsole/kwrited.cpp?v=3.5-branch#080:
QString txt = i18n("KWrited - Listening on Device %1").arg(pty->ttyName());
setCaption(txt);
puts(txt.local8Bit().data());

As KWrited is a KDED module, this message is printed when first app in KDE session is started. I am using KDialog to get some choice and this message is landing in kdialog output.

Solution: change this puts into kdDebug()
Comment 1 Krzysztof Lichota 2006-12-19 21:28:22 UTC
BTW. It is not the only app which uses puts to print debugging output, according to lxr.kde.org.
Comment 2 Krzysztof Lichota 2006-12-19 22:04:21 UTC
And kinit also prints some messages to stdout:
http://lxr.kde.org/source/KDE/kdelibs/kinit/lnusertemp.c?v=3.5-branch#087
Comment 3 Robert Knight 2006-12-19 23:51:36 UTC
Created attachment 18984 [details]
Updated binaries for kwrited which fix this bug.

Extract to /usr on Debian systems.
Comment 4 Robert Knight 2006-12-19 23:53:34 UTC
Hello,

Sorry, I meant to add this comment to the attachment.  Could you test the patched version of kwrited attached to this bug report.  It will still print the error message (unlike kdDebug which disappears when compiled in release mode), but to stderr instead.

If it does what you need I will commit the changes for KDE 3.5.6
Comment 5 Krzysztof Lichota 2006-12-20 12:46:13 UTC
It would be hard for me to test your binaries as this problem appears when using LiveCD image. If you really want, I will remaster CD to include your binaries, but I think the fix is simple enough to put in without testing binaries. I would expect that if any problems appear they would be related on depending on kwrited writing this to stdout. But I don't think it is the case. Anyway, it would be best to put this fix in as soon as possible, so that people start testing it on their complete KDE desktop.

And kwrited problem is only part of solution, the problem with kinit stays and spoils the output also.
Comment 6 Robert Knight 2006-12-20 16:21:39 UTC
> It would be hard for me to test your binaries as this problem 
> appears when using LiveCD image.

I see.  Trying to build a new LiveCD would be overkill.  

> think the fix is simple enough to put in without testing binaries.

I suppose this is true.  I have committed the change.
Comment 7 Krzysztof Lichota 2006-12-21 00:23:43 UTC
Thanks for quick fix for the bug. I wish other developers fixed bugs that quickly :)
Comment 8 George Kiagiadakis 2008-10-21 15:40:23 UTC
SVN commit 874385 by gkiagia:

Use KNotify in kwrited instead of popping up a QTextEdit.
FEATURE: 104019

Also, fix various other minor things in kwrited:
* Remove the useless includes.
* Use KPtyDevice instead of KPty and direct system calls.
* Remove the bell character together with carriage return from incoming
messages.
* Change the component name from "konsole" to "kwrited".
* Cleanup out-of-date comments and commented-out code.
* puts() becomes kDebug(). CCBUG: 139025



 M  +1 -0      CMakeLists.txt  
 M  +18 -82    kwrited.cpp  
 M  +8 -11     kwrited.h  
 A             kwrited.notifyrc  


WebSVN link: http://websvn.kde.org/?view=rev&revision=874385