Subject: bin/1326: vi editing bug
To: None <>
From: Neil J. McRae <>
List: netbsd-bugs
Date: 08/10/1995 15:22:09
>Number:         1326
>Category:       bin
>Synopsis:       vi editing bug
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 10 10:35:01 1995
>Originator:     Neil J. McRae
Demon Internet.
>Release:        Today's current at 15:00 BST
	libs Aug 6, bins Aug 6, vi was compiled as of todays current
System: NetBSD 1.0A NetBSD 1.0A (NETBSD) #1: Fri Aug 4 12:17:47 BST 1995 sparc

	In vi when editing a line with:
    set ts=4
    set wrapmargin=5
    set wrapscan
    When inserting text near the end of a line, what looks like to be a 
    memory leak or data going past bounds, The line is corrupt with lots of
   ^@'s Trying an ^[:e! to get the file back segfaults vi:

[no idea if this is any use]

Program terminated with signal 11, Segmentation fault.
#0  0x40cf244 in ?? ()
(gdb) bt
#0  0x40cf244 in ?? ()
#1  0x40c3248 in ?? ()
#2  0x40bdf94 in ?? ()
#3  0x40c1dfc in ?? ()
#4  0x5504 in ?? ()
#5  0x3cb4 in ?? ()
#6  0x17a00 in ?? ()
#7  0x137a0 in ?? ()
#8  0x11674 in ?? ()
#9  0x3443c in ?? ()
#10 0x26664 in ?? ()
#11 0x32678 in ?? ()
#12 0x37c88 in ?? ()
#13 0x711c in ?? ()

Install vi current, Use the settings mentioned above
Edit a file with a line like this:
       Exec    "elm"         exec rsh axe "exec /usr/X11R6/bin/xterm -fg skyblue -bg black -T Mail -n Mail -e /usr/local/bin/elm &" & </dev/ull >/dev/null 

In this example try and insert this after the "/usr/X11R6/bin/xterm" part,
-display NetBSD:0 and the problem should happen, then do ^[:e! and vi will 
seg fault.

A workaround for this was to add it in another part of the line...