NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/57072: nvi error "Error: move: l(24 + 0) c(80 + 0)"



(blymn@ added to cc:)

On 2022/10/24 11:55, Simon Burge wrote:
Description:
	nvi gives the an error like
		Error: move: l(24 + 0) c(80 + 0)
	under certain conditions where it tries to write a long
	status line after an operation (eg, file write).
How-To-Repeat:
	On a window that is 80 characters wide and:
	  jot 10 > /tmp/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	  vi /tmp/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	and type:
	  :w

I'm not sure whether nvi is not guilty here, but it seems that nvi hits
a curses bug or its undefined behavior.

If nvi is built with ncursesw from pkgsrc by this patch:

https://gist.github.com/rokuyama/233bae41dc5cef273dfb73a64423a7fd

the error does not occur.

With extra CTRACE output by this patch:

https://gist.github.com/rokuyama/1a7ea9f534805a302cc23c453cbf01fa

the error turned out to occur as follows. For 80x24 xterm screen:

(1) nvi outputs a 80-column message:

/tmp/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: 10 lines, 21 characters.

at the bottom line, i.e., (y, x) = (23, 0).

(2) Cursor moves to (23, 80), and this (y, x) is returned to getsyx().

(3) move(y, x) fails since x == win->maxx.

Here is full CTRACE for nvi:

http://www.netbsd.org/~rin/nvi-ctrace.20221025.gz

Thanks,
rin


Home | Main Index | Thread Index | Old Index