NetBSD Problem Report #54263

From martin@duskware.de  Sun Jun  2 11:25:38 2019
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 817DE7A174
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  2 Jun 2019 11:25:38 +0000 (UTC)
Message-Id: <20190602112530.21ABB5CC85E@emmas.aprisoft.de>
Date: Sun,  2 Jun 2019 13:25:30 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: curses changes broke sysinst
X-Send-Pr-Version: 3.95

>Number:         54263
>Category:       lib
>Synopsis:       curses changes broke sysinst
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    blymn
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 02 11:30:00 +0000 2019
>Closed-Date:    Mon Jun 10 14:36:39 +0000 2019
>Last-Modified:  Mon Jun 10 14:36:39 +0000 2019
>Originator:     Martin Husemann
>Release:        NetBSD 8.99.42
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-owl.duskware.de 8.99.42 NetBSD 8.99.42 (NIGHT-OWL) #672: Fri May 31 18:12:54 CEST 2019 martin@night-owl.duskware.de:/usr/src/sys/arch/amd64/compile/NIGHT-OWL amd64
Architecture: x86_64
Machine: amd64
>Description:

Some sysinst menus do not display correctly after recent curses changes.
If this is a menuc or sysinst bug, someone please explain what needs to
change there to me ,-)

>How-To-Repeat:

You can reproduce on a running system with shared libcurses, no need to
prepare install media, but it needs a bit of setup:

As root do:

One time preparation:

cd /var/tmp
dd if=/dev/zero of=disk.img seek=6g count=1
vnconfig -c vnd0 disk.img
disklabel -eI vnd0		(just exit the editor)
newfs -O2 vnd0a
mount /dev/vnd0a /mnt
mkdir /mnt/etc
touch /mnt/etc/fstab
umount /mnt

Then to reproduce:

	sysinst

select keyboard type (unchanged) and prefered language, then:

	f: Config menu 
	a: vnd0			(or not "a" if you have other disks around)

You will get a menu like:


 Configure the additional items as needed.


 a: Configure network                                  configure
 b: Timezone                                           UTC
 c: Root shell
 d: Change root password                               ***EMPTY***
 e: Enable installation of binary packages             install
 f: Fetch and unpack pkgsrc                            install
 g: Enable sshd                                        NO
 h: Enable ntpd                                        NO
 i: Run ntpdate at boot                                NO
 j: Enable mdnsd                                       NO
 k: Enable xdm                                         NO
 l: Enable cgd                                         NO
 m: Enable lvm                                         NO
 n: Enable raidframe                                   NO
 o: Add a user
>x: Finished configuring

with the last line (x:) highlighted.

Now move the selection up (depending on keyboard type with arrows, or using
^P for up / ^N for down.

Moving the selection garbles the screen. The drawn highlight bar is 
"duplicated" and the content previously below it is repeated with an y
offset. Plain (unhighlighted) content after two "ups":


 Configure the additional items as needed.                                      


 a: Configure network                                  configure                
 b: Timezone                                           UTC                      
 c: Root shell                                                                  
 d: Change root password                               ***EMPTY***              
 e: Enable installation of binary packages             install                  
 f: Fetch and unpack pkgsrc                            install                  
 g: Enable sshd                                        NO                       
 h: Enable ntpd                                        NO                       
 i: Run ntpdate at boot                                NO                       
 j: Enable mdnsd                                       NO                       
 k: Enable xdm                                         NO                       
 l: Enable cgd                                         NO                       
 m: Enable lvm                                         NO                       
 n: Enable raidframe                                   NO                       
>o: Add a user                                                                  
 x: Finished configuring                                                        
>n: Enable raidframe                                   NO                       
 o: Add a user


This started happening with recent libcurses changes. It still works fine with
a libcurses from ~ May 18, but breaks with a May 26 one.


>Fix:
n/a

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: lib-bug-people->blymn
Responsible-Changed-By: blymn@NetBSD.org
Responsible-Changed-When: Sun, 02 Jun 2019 22:24:06 +0000
Responsible-Changed-Why:
I will take this.


From: Brett Lymn <blymn@internode.on.net>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: lib/54263: curses changes broke sysinst
Date: Mon, 3 Jun 2019 07:59:34 +0930

 This sounds very similar to something I saw when debugging the previous
 changes, mutt would do exactly this.  It turned out that the current
 line was not being properly maintained in add_wch.

 It may not be this though, a change to move() meant that a multitude of
 errors were hidden by the display being constantly refreshed due to
 lines being marked dirty without the change pointers being modified
 which resulted in the refresh code never un-dirtying the line flags.

 -- 
 Brett Lymn
 --
 Sent from my NetBSD device.

 "We are were wolves",
 "You mean werewolves?",
 "No we were wolves, now we are something else entirely",
 "Oh"

From: "Brett Lymn" <blymn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54263 CVS commit: src/lib/libcurses
Date: Sun, 9 Jun 2019 07:40:15 +0000

 Module Name:	src
 Committed By:	blymn
 Date:		Sun Jun  9 07:40:14 UTC 2019

 Modified Files:
 	src/lib/libcurses: add_wch.c add_wchstr.c addbytes.c addch.c
 	    addchnstr.c addnstr.c addwstr.c copywin.c curses_private.h delch.c
 	    erase.c get_wch.c get_wstr.c getch.c getstr.c in_wch.c in_wchstr.c
 	    inch.c inchstr.c ins_wch.c ins_wstr.c insch.c insstr.c instr.c
 	    inwstr.c line.c move.c newwin.c printw.c refresh.c scroll.c

 Log Message:
 Rework previous fix for getch cursor position when cursor is moved
 without refresh.  If the window is not dirty but the window cursor
 position does not match curscr then move the cursor.  This fixes
 the issues seen in PR lib/54263.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/lib/libcurses/add_wch.c
 cvs rdiff -u -r1.7 -r1.8 src/lib/libcurses/add_wchstr.c \
     src/lib/libcurses/addchnstr.c src/lib/libcurses/get_wstr.c \
     src/lib/libcurses/in_wchstr.c src/lib/libcurses/inwstr.c
 cvs rdiff -u -r1.51 -r1.52 src/lib/libcurses/addbytes.c
 cvs rdiff -u -r1.20 -r1.21 src/lib/libcurses/addch.c src/lib/libcurses/move.c
 cvs rdiff -u -r1.16 -r1.17 src/lib/libcurses/addnstr.c
 cvs rdiff -u -r1.5 -r1.6 src/lib/libcurses/addwstr.c
 cvs rdiff -u -r1.18 -r1.19 src/lib/libcurses/copywin.c
 cvs rdiff -u -r1.70 -r1.71 src/lib/libcurses/curses_private.h
 cvs rdiff -u -r1.25 -r1.26 src/lib/libcurses/delch.c \
     src/lib/libcurses/scroll.c
 cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/erase.c
 cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/get_wch.c
 cvs rdiff -u -r1.72 -r1.73 src/lib/libcurses/getch.c
 cvs rdiff -u -r1.26 -r1.27 src/lib/libcurses/getstr.c
 cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/in_wch.c \
     src/lib/libcurses/insstr.c src/lib/libcurses/instr.c
 cvs rdiff -u -r1.13 -r1.14 src/lib/libcurses/inch.c \
     src/lib/libcurses/ins_wch.c src/lib/libcurses/ins_wstr.c
 cvs rdiff -u -r1.9 -r1.10 src/lib/libcurses/inchstr.c
 cvs rdiff -u -r1.24 -r1.25 src/lib/libcurses/insch.c
 cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/line.c
 cvs rdiff -u -r1.56 -r1.57 src/lib/libcurses/newwin.c
 cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/printw.c
 cvs rdiff -u -r1.110 -r1.111 src/lib/libcurses/refresh.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: blymn@NetBSD.org
State-Changed-When: Sun, 09 Jun 2019 07:56:23 +0000
State-Changed-Why:
Fix has been commited, requesting feedback.


State-Changed-From-To: feedback->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Mon, 10 Jun 2019 14:36:39 +0000
State-Changed-Why:
Works for me, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.