Bug 139169

Summary: Random display corruption in UTF-8 mode
Product: [Applications] konsole Reporter: shattered
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: esigra
Priority: NOR    
Version: 1.6.4   
Target Milestone: ---   
Platform: NetBSD pkgsrc   
OS: NetBSD   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: cat this file to stdout.
corrupted display
Normal display, using sed ''
Corrupted display

Description shattered 2006-12-23 14:41:10 UTC
Version:           1.6.4 (using KDE KDE 3.5.4)
Installed from:    NetBSD pkgsrc
Compiler:          gcc version 3.3.3 (NetBSD nb3 20040520) 
OS:                NetBSD

- Connect to remote machine using ssh
- Change Konsole charset to utf-8
- Use any application that will output non-ASCII characters (Cyrillic, for example).  
- From time to time, one or more characters will be substituted by 'replacement character'; these usually go away after a refresh.

I first noticed the problem in irssi (IRC client), but can easily reproduce it just by 'cat'ing a text file to stdout.
Comment 1 shattered 2006-12-23 14:43:23 UTC
Created attachment 19016 [details]
cat this file to stdout.
Comment 2 shattered 2006-12-23 14:51:34 UTC
Created attachment 19017 [details]
corrupted display
Comment 3 Kiril Kirov 2007-02-02 12:54:32 UTC
Same problem here. I get random characters corruption using UTF-8 cyrillic on Konsole 1.6.4 (FreeBSD 6.2, KDE 3.5.4). I'm working locally so the ssh seem irrelevant to the problem.
Comment 4 Robert Knight 2007-02-04 15:53:49 UTC
I am not able to reproduce this in KDE 3.5.6 using Qt 3.3.6.

There is a slightly different problem which shows up in KDE 4 when catting the attached file where three or four lines are one character shorter than the others.
Comment 5 shattered 2007-02-04 17:12:48 UTC
Perhaps the corrupted character's encoded form is split between two fixed-size buffers (given the look of corrupted display)...
Comment 6 Robert Knight 2007-02-04 18:11:01 UTC
> Perhaps the corrupted character's encoded form is split between 
> two fixed-size buffers (given the look of corrupted display)... 

I thought about that, but internally Konsole uses a Qt class to do the decoding which can remember state information between calls.  So if you decode a buffer which ends with the first half of a two-byte character, that final character will not be added to the output until the other half is available when the next batch of input comes in.  But yes, I agree that I think this is where something may be going wrong.

I cannot reproduce the problem in KDE 3, but under KDE 4 it does not show up if you execute:

cat file-attached-to-this-report | sed ''

Can anyone who is able to reproduce this in KDE 3 try running the above command?
Comment 7 shattered 2007-02-04 18:28:04 UTC
Interesting.  I no longer can reproduce this on KDE 3.5.5 / Konsole 1.6.5 / Qt 3.3.6 by cat'ing the file... I'll see if it appears in ssh session.
Comment 8 Kiril Kirov 2007-02-04 22:01:21 UTC
I tried to run the above command. It shows the text without problems. However if I try to view the file with less, it shows corrupted text. Hope that helps.
Comment 9 shattered 2007-02-06 23:07:22 UTC
Downgraded just the Konsole to 1.6.4 (KDE is still at 3.5.5) -> still cannot reproduce the bug.  Will try to downgrade to 3.5.4...
Comment 10 Kiril Kirov 2007-02-07 16:19:46 UTC
Created attachment 19577 [details]
Normal display, using sed ''
Comment 11 Kiril Kirov 2007-02-07 16:20:46 UTC
Created attachment 19578 [details]
Corrupted display
Comment 12 shattered 2007-03-27 21:46:41 UTC
Never saw the problem again in 3.5.6/1.6.6.
Comment 13 shattered 2007-07-08 10:35:48 UTC
Doesn't occur in 3.5.7/1.6.6 either.