Bug 133511 - Garbage characters occasionally appear in Konsole
Summary: Garbage characters occasionally appear in Konsole
Status: RESOLVED REMIND
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6.4
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-03 16:45 UTC by Andrey Golovizin
Modified: 2011-07-24 12:54 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
example screenshot (12.43 KB, image/png)
2006-09-03 16:47 UTC, Andrey Golovizin
Details
How to reproduce the bug: (1.36 KB, image/png)
2006-09-04 21:32 UTC, Andrey Golovizin
Details
Program to reproduce the bug. (1.41 KB, text/plain)
2009-01-02 14:18 UTC, esigra
Details
File with ncurses draw-commands to replay. (271.70 KB, application/octet-stream)
2009-01-02 14:22 UTC, esigra
Details
A plain C program to reproduce the bug (just in case someone has a problem with Ada). (1.36 KB, text/plain)
2009-01-02 16:13 UTC, esigra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Golovizin 2006-09-03 16:45:59 UTC
Version:           1.6.4 (using KDE 3.5.4, Gentoo)
Compiler:          gcc version 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)
OS:                Linux (x86_64) release 2.6.17-gentoo-r7

When running some curses-based applications, garbage characters sometimes appear in the terminal window. It is unlikely to be a ncurses bug because other terminals work just fine (I've tried xterm and vte/gnome-terminal.
Comment 1 Andrey Golovizin 2006-09-03 16:47:18 UTC
Created attachment 17628 [details]
example screenshot
Comment 2 Robert Knight 2006-09-04 13:56:10 UTC
Hello,

Are there reliable ways of reproducing this?  Or failing that, are there any particular applications which frequently cause this problem to appear?
Comment 3 Andrey Golovizin 2006-09-04 21:32:40 UTC
Created attachment 17636 [details]
How to reproduce the bug:

1. run Midnight Commander or some other console application using pseudographic
characters for drawing lines;
2. hold down shift key and select a piece of horizontal line with your mouse
(10-20 characters should be enough);
3. paste the selection into your shell session in Konsole by pressing middle
mouse button or whatever; repeat several times for better effect;
4. after that, if you are lucky, something similar to the attached screenshot
should appear on your screen :)

I also noticed that the bug only appears with UTF-8 locale (and Konsole
encoding set to UTF-8).
Comment 4 Robert Knight 2006-09-06 22:27:55 UTC
Hello,

Yes, I think I see what you mean.  I see odd "question-mark box" characters appearing in the middle of one or two of the lines.

They don't appear in the current KDE 4 build of Konsole - but running mc it seems that there are a couple of new glitches, possibly related.  The box around the directory view is broken at the bottom.
Comment 5 Amand Tihon 2006-09-11 16:16:42 UTC
This bug tends to appear with screen/irssi too. I don't know which one is the culprit.

It seems to happen to "special" characters only (chars with accents like éèà, or line drawings in mc).
Comment 6 Sami Liedes 2006-12-04 22:33:30 UTC
I haven't seen this happen for a while now. Perhaps fixed in 3.5.5 or something?
Comment 7 Robert Knight 2006-12-05 00:43:24 UTC
Possibly.  I don't see any specific commits related to this.  I am leaving this open because the test case given reveals some other problems in the KDE 4 build which I have yet to fix.
Comment 8 esigra 2009-01-02 14:18:12 UTC
Created attachment 29824 [details]
Program to reproduce the bug.

This program can easily reproduce the bug by replaying ncurses draw-commands from a file (previously recorded by a real ncurses program). Build it with the following command:
gnatmake -I/usr/lib/ada/adainclude -L/usr/lib/ada/adainclude -L/usr/lib/ada/adalib -lAdaCurses -gnata -g -O3 -gnatfnN -gnatwah -gnaty -gnatyM99 reproduce_konsole_bug133511
Comment 9 esigra 2009-01-02 14:22:38 UTC
Created attachment 29826 [details]
File with ncurses draw-commands to replay.

Sequence of ncurses draw-commands that can be replayed (with the previously attached program) to reproduce the bug. First run it in a virtual terminal where everything works as it should. The watch it fail in Konsole. Make sure to have the file in the working-directory when you run the replay program.

By the way, my locale is sv_SE.UTF-8.
Comment 10 esigra 2009-01-02 16:13:19 UTC
Created attachment 29829 [details]
A plain C program to reproduce the bug (just in case someone has a problem with Ada).

Here is a plain C program to reproduce the bug (just in case someone has a problem with Ada). Build it with the following command:
gcc -lcurses -Wall -Wextra -o reproduce_konsole_bug133511 reproduce_konsole_bug133511.c
Comment 11 Robert Knight 2009-01-02 16:56:04 UTC
Hi,

Thank-you for making the test case but do you have a smaller data file to work with which still shows the problem?  That will make finding the cause quicker.
Comment 12 esigra 2009-01-02 17:50:32 UTC
No, I just made this one file. When I run it I see the problems within a few seconds, so I thought that it would be small enough. Have yo tried it? Were you able to confirm the bug? Did you try it in a virtual terminal as well? Did it work right there? Maybe I could make a smaller file.
Comment 13 esigra 2009-01-02 18:11:30 UTC
Here follows a much smaller program (no data file needed). It shows several garbage characters at different places in Konsole, while a virtual terminal shows a single '?' at (7, 7), where the character should be. Maybe a program is not allowed to print character number 197, but I think that the virtual terminal handles the error better than Konsole.
#include <curses.h>
int main() {
  initscr ();
  curs_set (0);
  mvaddch (7, 7, 197 | A_REVERSE);
  refresh (); 
  getchar ();
  endwin ();
  return 0;
}
Comment 14 Robert Knight 2009-01-02 19:49:38 UTC
> When I run it I see the problems within a few seconds

I would still need to look at the interpretation of individual drawing commands though, of which a 270KB file could contain a lot so I'd have to find some way or another to narrow it down first.

Thanks for comment #13, I'll have a look later.
Comment 15 Jekyll Wu 2011-07-24 05:20:16 UTC
Is this report still valid?

I tested the program from comment #13 in konsole-2.7.999 and it showed a '?' at (7,7) on a blank screen with no garbage characters, as it does in linux console and xterm.
Comment 16 Kurt Hindenburg 2011-07-24 12:54:34 UTC
Reopen if anyone notices this issue with a newish version.