public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.26-rcX VC console scrolling regression
@ 2008-05-08  4:46 David Miller
  2008-05-08  6:02 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: David Miller @ 2008-05-08  4:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: jengelh, adaplas, hpa, alan, akpm, torvalds


This change:

commit c9e587abfdec2c2aaa55fab83bcb4972e2f84f9b
Author: Jan Engelhardt <jengelh@computergmbh.de>
Date:   Tue Apr 29 00:59:46 2008 -0700

    vt: fix background color on line feed
    
    A command that causes a line feed while a background color is active,
    such as
    
    	perl -e 'print "x" x 60, "\e[44m", "x" x 40, "\e[0m\n"'
    and
    	perl -e 'print "x" x 40, "\e[44m\n", "x" x 40, "\e[0m\n"'
    
    causes the line that was started as a result of the line feed to be completely
    filled with the currently active background color instead of the default
    color.
    
    When scrolling, part of the current screen is memcpy'd/memmove'd to the new
    region, and the new line(s) that will appear as a result are cleared using
    memset.  However, the lines are cleared with vc->vc_video_erase_char, causing
    them to be colored with the currently active background color.  This is
    different from X11 terminal emulators which always paint the new lines with
    the default background color (e.g.  `xterm -bg black`).
    
    The clear operation (\e[1J and \e[2J) also use vc_video_erase_char, so a new
    vc->vc_scrl_erase_char is introduced with contains the erase character used
    for scrolling, which is built from vc->vc_def_color instead of vc->vc_color.
    
    Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
    Cc: "Antonino A. Daplas" <adaplas@pol.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Causes garbage characters to appear at the end of lines on my VCs when
scrolling.

They look like lowercase 'c' characters with a '.' above them, and they
are colored light blue.  The rest of the console text is fine.

I think it might be because my VC gets put into a UTF8 mode or something
like that via the init scripts?  It seems to start happening right when
the init scripts print "Setting up console font and keymap", which seems
to come from /etc/init.d/console-setup which runs /bin/setupcon

This is with a stock Ubuntu 7.10 installation.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-08  4:46 2.6.26-rcX VC console scrolling regression David Miller
@ 2008-05-08  6:02 ` Andrew Morton
  2008-05-08 15:04   ` Linus Torvalds
  2008-05-08  9:13 ` Jan Engelhardt
  2008-05-08 11:50 ` Jan Engelhardt
  2 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2008-05-08  6:02 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, jengelh, adaplas, hpa, alan, torvalds

On Wed, 07 May 2008 21:46:37 -0700 (PDT) David Miller <davem@davemloft.net> wrote:

> 
> This change:
> 
> commit c9e587abfdec2c2aaa55fab83bcb4972e2f84f9b
> Author: Jan Engelhardt <jengelh@computergmbh.de>
> Date:   Tue Apr 29 00:59:46 2008 -0700
> 
>     vt: fix background color on line feed
>     
>     A command that causes a line feed while a background color is active,
>     such as
>     
>     	perl -e 'print "x" x 60, "\e[44m", "x" x 40, "\e[0m\n"'
>     and
>     	perl -e 'print "x" x 40, "\e[44m\n", "x" x 40, "\e[0m\n"'
>     
>     causes the line that was started as a result of the line feed to be completely
>     filled with the currently active background color instead of the default
>     color.
>     
>     When scrolling, part of the current screen is memcpy'd/memmove'd to the new
>     region, and the new line(s) that will appear as a result are cleared using
>     memset.  However, the lines are cleared with vc->vc_video_erase_char, causing
>     them to be colored with the currently active background color.  This is
>     different from X11 terminal emulators which always paint the new lines with
>     the default background color (e.g.  `xterm -bg black`).
>     
>     The clear operation (\e[1J and \e[2J) also use vc_video_erase_char, so a new
>     vc->vc_scrl_erase_char is introduced with contains the erase character used
>     for scrolling, which is built from vc->vc_def_color instead of vc->vc_color.
>     
>     Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
>     Cc: "Antonino A. Daplas" <adaplas@pol.net>
>     Cc: "H. Peter Anvin" <hpa@zytor.com>
>     Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
>     Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> 
> Causes garbage characters to appear at the end of lines on my VCs when
> scrolling.
> 
> They look like lowercase 'c' characters with a '.' above them, and they
> are colored light blue.  The rest of the console text is fine.
> 
> I think it might be because my VC gets put into a UTF8 mode or something
> like that via the init scripts?  It seems to start happening right when
> the init scripts print "Setting up console font and keymap", which seems
> to come from /etc/init.d/console-setup which runs /bin/setupcon
> 
> This is with a stock Ubuntu 7.10 installation.

Thanks, Dave.  I queued the revert but I'll hold off for 48-odd hours if
that's OK - it might just be something silly.


If we continue in this way, patch-2.6.26 will consist solely of:

--- a/Makefile
+++ a/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 25
+SUBLEVEL = 26
 EXTRAVERSION =
 NAME = Funky Weasel is Jiggy wit it
 
:(

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-08  4:46 2.6.26-rcX VC console scrolling regression David Miller
  2008-05-08  6:02 ` Andrew Morton
@ 2008-05-08  9:13 ` Jan Engelhardt
  2008-05-08  9:21   ` David Miller
  2008-05-08 11:50 ` Jan Engelhardt
  2 siblings, 1 reply; 10+ messages in thread
From: Jan Engelhardt @ 2008-05-08  9:13 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, adaplas, hpa, alan, akpm, torvalds


On Thursday 2008-05-08 06:46, David Miller wrote:
>
>Causes garbage characters to appear at the end of lines on my VCs when
>scrolling.
>
>They look like lowercase 'c' characters with a '.' above them, and they
>are colored light blue.  The rest of the console text is fine.

i386 or sparc64?

In trying to reproduce it, Ubuntu already died on me (insert big rant
here) and I have no idea how to fix that if I want to keep the
stockness of the install:

-->>>--
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Cache data unavailable
sd 2:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1 sdb2 < sdb5 >
sd 2:0:0:0: [sdb] Attached SCSI disk
sd 2:0:0:0: Attached scsi generic sg2 type 0
Done.
Begin: Running /scripts/local-premount ...
Done.
mount: Mounting /dev/sdb1 on /root failed: No such device
Begin: Running /scripts/local-bottom ...
Done.
Done.
Begin: Running /scripts/init-bottom ...
mount: Mounting /root/dev on /dev/.static/dev failed: No such file or directory.
Done.
mount: Mounting /sys on /root/sys failed: No such file or directory
mount: Mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn't have /sbin/init


BusyBox v1.1.3 (Debian 1:1.1.3-5ubuntu7) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)
---<<<---


>I think it might be because my VC gets put into a UTF8 mode or something
>like that via the init scripts?

opensuse also switches to utf8 (though noting that the kernel starts
with utf8 by default since 2.6.24) and I have not noticed anything bad.

Are you using a serial console?

>  It seems to start happening right when
>the init scripts print "Setting up console font and keymap", which seems
>to come from /etc/init.d/console-setup which runs /bin/setupcon
>
>This is with a stock Ubuntu 7.10 installation.
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-08  9:13 ` Jan Engelhardt
@ 2008-05-08  9:21   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2008-05-08  9:21 UTC (permalink / raw)
  To: jengelh; +Cc: linux-kernel, adaplas, hpa, alan, akpm, torvalds

From: Jan Engelhardt <jengelh@medozas.de>
Date: Thu, 8 May 2008 11:13:37 +0200 (CEST)

> 
> On Thursday 2008-05-08 06:46, David Miller wrote:
> >
> >Causes garbage characters to appear at the end of lines on my VCs when
> >scrolling.
> >
> >They look like lowercase 'c' characters with a '.' above them, and they
> >are colored light blue.  The rest of the console text is fine.
> 
> i386 or sparc64?

sparc64.

> Are you using a serial console?

:-/  No, why would I report a VC console output bug if I were
using a serial console?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-08  4:46 2.6.26-rcX VC console scrolling regression David Miller
  2008-05-08  6:02 ` Andrew Morton
  2008-05-08  9:13 ` Jan Engelhardt
@ 2008-05-08 11:50 ` Jan Engelhardt
  2008-05-09  6:26   ` David Miller
  2 siblings, 1 reply; 10+ messages in thread
From: Jan Engelhardt @ 2008-05-08 11:50 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, adaplas, hpa, alan, akpm, torvalds


On Thursday 2008-05-08 06:46, David Miller wrote:
>
>Causes garbage characters to appear at the end of lines on my VCs when
>scrolling.
>
(Gotten past the initramfs now..)
>They look like lowercase 'c' characters with a '.' above them, and they
>are colored light blue.  The rest of the console text is fine.
>I think it might be because my VC gets put into a UTF8 mode or something
>like that via the init scripts?  It seems to start happening right when
>the init scripts print "Setting up console font and keymap", which seems
>to come from /etc/init.d/console-setup which runs /bin/setupcon
>This is with a stock Ubuntu 7.10 installation.

I "reproduced" it this way on Ubuntu on i386 with fbcon (which you
are likely to be using on sparc64), when switching from a 256 to
512-glyph font. So far, only Ubuntu seems to exhibit this problem,
I am going to test Fedora for its fitness now.

# Right after boot...
	showconsolefont
# Trigger
	setfont Arabic-VGA16
	showconsolefont

# Resolve bug with 'reset'
	reset
	while $not_scrolled; do
		showconsolefont
	done;

My guess is that you see the effects of incomplete font table/position
switching, something along the lines a `cat /dev/urandom` would cause.
Using the very same kernel and boot params (vga=791 or anything to
switch it to fbcon), I cannot trigger the problem on opensuse.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-08  6:02 ` Andrew Morton
@ 2008-05-08 15:04   ` Linus Torvalds
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Torvalds @ 2008-05-08 15:04 UTC (permalink / raw)
  To: Andrew Morton; +Cc: David Miller, linux-kernel, jengelh, adaplas, hpa, alan



On Wed, 7 May 2008, Andrew Morton wrote:
> 
> If we continue in this way, patch-2.6.26 will consist solely of:
> 
> --- a/Makefile
> +++ a/Makefile
> @@ -1,6 +1,6 @@
>  VERSION = 2
>  PATCHLEVEL = 6
> -SUBLEVEL = 25
> +SUBLEVEL = 26
>  EXTRAVERSION =
>  NAME = Funky Weasel is Jiggy wit it
>  
> :(

Why the frowny face. That would be beautiful ;)

		Linus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-08 11:50 ` Jan Engelhardt
@ 2008-05-09  6:26   ` David Miller
  2008-05-09 19:24     ` Jan Engelhardt
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2008-05-09  6:26 UTC (permalink / raw)
  To: jengelh; +Cc: linux-kernel, adaplas, hpa, alan, akpm, torvalds

From: Jan Engelhardt <jengelh@medozas.de>
Date: Thu, 8 May 2008 13:50:57 +0200 (CEST)

> My guess is that you see the effects of incomplete font table/position
> switching, something along the lines a `cat /dev/urandom` would cause.
> Using the very same kernel and boot params (vga=791 or anything to
> switch it to fbcon), I cannot trigger the problem on opensuse.

Jan, there is code in drivers/video/console/fbcon.c:fbcon_do_set_font()
which makes changes to vc->vc_video_erase_char, maybe that code needs
to update the new vc->vc_scrl_erase_char you added?

It would be nice if you could audit the tree to see if any other cases
have been missed like this as well.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-09  6:26   ` David Miller
@ 2008-05-09 19:24     ` Jan Engelhardt
  2008-05-09 21:55       ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Engelhardt @ 2008-05-09 19:24 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, adaplas, hpa, alan, akpm, torvalds


On Friday 2008-05-09 08:26, David Miller wrote:
>> My guess is that you see the effects of incomplete font table/position
>> switching, something along the lines a `cat /dev/urandom` would cause.
>> Using the very same kernel and boot params (vga=791 or anything to
>> switch it to fbcon), I cannot trigger the problem on opensuse.
>
>Jan, there is code in drivers/video/console/fbcon.c:fbcon_do_set_font()
>which makes changes to vc->vc_video_erase_char, maybe that code needs
>to update the new vc->vc_scrl_erase_char you added?
>
>It would be nice if you could audit the tree to see if any other cases
>have been missed like this as well.
>
Try this patch please.

---
 drivers/video/console/fbcon.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index ca2a543..774f803 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2508,6 +2508,9 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
 			c = vc->vc_video_erase_char;
 			vc->vc_video_erase_char =
 			    ((c & 0xfe00) >> 1) | (c & 0xff);
+			c = vc->vc_def_color;
+			vc->vc_scrl_erase_char =
+			    ((c & 0xFE00) >> 1) | (c & 0xFF);
 			vc->vc_attr >>= 1;
 		}
 	} else if (!vc->vc_hi_font_mask && cnt == 512) {
@@ -2538,9 +2541,14 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
 			if (vc->vc_can_do_color) {
 				vc->vc_video_erase_char =
 				    ((c & 0xff00) << 1) | (c & 0xff);
+				c = vc->vc_def_color;
+				vc->vc_scrl_erase_char =
+				    ((c & 0xFF00) << 1) | (c & 0xFF);
 				vc->vc_attr <<= 1;
-			} else
+			} else {
 				vc->vc_video_erase_char = c & ~0x100;
+				vc->vc_scrl_erase_char = c & ~0x100;
+			}
 		}
 
 	}
-- 
1.5.5.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-09 19:24     ` Jan Engelhardt
@ 2008-05-09 21:55       ` David Miller
  2008-05-10  7:48         ` Jan Engelhardt
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2008-05-09 21:55 UTC (permalink / raw)
  To: jengelh; +Cc: linux-kernel, adaplas, hpa, alan, akpm, torvalds

From: Jan Engelhardt <jengelh@medozas.de>
Date: Fri, 9 May 2008 21:24:20 +0200 (CEST)

> 
> On Friday 2008-05-09 08:26, David Miller wrote:
> >> My guess is that you see the effects of incomplete font table/position
> >> switching, something along the lines a `cat /dev/urandom` would cause.
> >> Using the very same kernel and boot params (vga=791 or anything to
> >> switch it to fbcon), I cannot trigger the problem on opensuse.
> >
> >Jan, there is code in drivers/video/console/fbcon.c:fbcon_do_set_font()
> >which makes changes to vc->vc_video_erase_char, maybe that code needs
> >to update the new vc->vc_scrl_erase_char you added?
> >
> >It would be nice if you could audit the tree to see if any other cases
> >have been missed like this as well.
> >
> Try this patch please.

That seems to fix the bug, thanks Jan.

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 2.6.26-rcX VC console scrolling regression
  2008-05-09 21:55       ` David Miller
@ 2008-05-10  7:48         ` Jan Engelhardt
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Engelhardt @ 2008-05-10  7:48 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, adaplas, hpa, alan, akpm, torvalds


On Friday 2008-05-09 23:55, David Miller wrote:
>> >
>> Try this patch please.
>
>That seems to fix the bug, thanks Jan.
>
>Acked-by: David S. Miller <davem@davemloft.net>
>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-05-10  7:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08  4:46 2.6.26-rcX VC console scrolling regression David Miller
2008-05-08  6:02 ` Andrew Morton
2008-05-08 15:04   ` Linus Torvalds
2008-05-08  9:13 ` Jan Engelhardt
2008-05-08  9:21   ` David Miller
2008-05-08 11:50 ` Jan Engelhardt
2008-05-09  6:26   ` David Miller
2008-05-09 19:24     ` Jan Engelhardt
2008-05-09 21:55       ` David Miller
2008-05-10  7:48         ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox