Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 1996 17:17:04 -0600 (MDT)
From:      marcs@worldgate.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1411: vi dumps core when using 'set list'
Message-ID:  <199607202317.RAA13314@gras-varg.worldgate.com>
Resent-Message-ID: <199607202320.QAA23769@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1411
>Category:       bin
>Synopsis:       vi dumps core when scrolling through files in 'set list' mode
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 20 16:20:01 PDT 1996
>Last-Modified:
>Originator:     marcs@worldgate.com
>Organization:
>Release:        FreeBSD 2.1-STABLE i386
>Environment:

2.1.5-RELEASE; also stable for the week or two (at least) leading
up to release.


>Description:

After doing a ':set list', when a line is just long enough so that
the last character before the '$' indicating end of line would be
in column 80, vi core dumps when it gets to displaying the '$' on
the next line.

After recompiling vi with debugging information, gdb gives me the following:

$ gdb vi/common/nvi nvi.core
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (i386-unknown-freebsd),
Copyright 1994 Free Software Foundation, Inc...
Core was generated by `nvi'.
Program terminated with signal 11, Segmentation fault.
Cannot access memory at address 0x76010.
#0  0x312b6 in svi_line (sp=0x3f800, ep=0x45100, smp=0x869cc, yp=0x0, xp=0x0)
    at /usr/var/tmp/vi/common/../svi/svi_line.c:376
376                     smp->c_ecsize = smp->c_eclen = KEY_LEN(sp, ch);
(gdb) where
#0  0x312b6 in svi_line (sp=0x3f800, ep=0x45100, smp=0x869cc, yp=0x0, xp=0x0)
    at /usr/var/tmp/vi/common/../svi/svi_line.c:376
#1  0x3f800 in end ()
#2  0x34695 in svi_sm_1up (sp=0x3f800, ep=0x45100)
    at /usr/var/tmp/vi/common/../svi/svi_smap.c:766
#3  0x31a12 in svi_paint (sp=0x3f800, ep=0x45100)
    at /usr/var/tmp/vi/common/../svi/svi_refresh.c:314
#4  0x3162c in svi_refresh (sp=0x3f800, ep=0x45100)
    at /usr/var/tmp/vi/common/../svi/svi_refresh.c:140
#5  0x2e2e5 in vi (sp=0x3f800, ep=0x45100)
    at /usr/var/tmp/vi/common/../vi/vi.c:100
#6  0x32f24 in svi_screen_edit (sp=0x3f800, ep=0x45100)
    at /usr/var/tmp/vi/common/../svi/svi_screen.c:225
#7  0x580c in main (argc=2, argv=0xefbfdd60) at main.c:435

The binary I'm using and the core file it generated are available
upon request.  I'm not sure that this is a problem involving only
vi, since the vi source does not seem to have any significant
changes from 2.1.0 and the problem was not present in 2.1.0

>How-To-Repeat:

Using version 1.36.4.5 of sys/scsi/st.c, input the following from the keyboard:

	vi st.c
	:set list 
	172j12jj

After the last j, vi core dumps displaying line 185.  Same thing
happens when scrolling via other means, but not when you go to line
185 before doing a 'set list', and then do a 'set list'.


>Fix:
	
	

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607202317.RAA13314>