Subject: kern/36703: pccons can corrupt the screen
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 07/29/2007 22:05:00
>Number:         36703
>Category:       kern
>Synopsis:       pccons can corrupt the screen
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 29 22:05:00 +0000 2007
>Originator:     Julio M. Merino Vidal
>Release:        NetBSD 4.99.25
Julio M. Merino Vidal <>
	Not relevant.  Reporting based on code inspection.
	The pccons driver in NetBSD/arc uses bcopy to implement some movement
	of screen contents.  This is incorrect because in some cases the source
	and target regions may overlap, resulting in screen corruption.

	I observed this same behavior in NetBSD/shark.  During sysinst the
	screen was corrupted: duplicates of messages appeared where the screen
	was supposed to be blank instead.  I expect the same thing to happen
	in arc, but I cannot check since I do not have the appropriate

	For more details see:
	A possibility: use sysinst.  When reaching the sets selection menu,
	choose "Full distribution" and the screen should be corrupted at
	that point, assuming that the following menu is the one that lets
	you decide if you want to change the disklabel or not.  (Otherwise
	curses may decide to use another algorithm to refresh the screen and
	not show the problem.)
	The fix involves replacing the calls to bcopy by calls to memmove,
	which is safe to regions that overlap.  However, the pccons in arc
	provides its own wcopy function (a bcopy which works on words
	instead of bytes) which is used in some situations.  Fixing this one
	requires a rewrite of the function and I don't dare to do it without
	being able to test the results.  Hence why I'm filing this report.