Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducible crash on OpenBSD #8

Closed
bentley opened this issue Oct 24, 2013 · 3 comments
Closed

Reproducible crash on OpenBSD #8

bentley opened this issue Oct 24, 2013 · 3 comments

Comments

@bentley
Copy link
Collaborator

bentley commented Oct 24, 2013

Create a file consisting of one line, exactly as follows:

XXXXXXXXXXXXX           YYYYYYYYYYYYYYYYY

(That's 13 X, followed by two tabs, followed by 17 Y.)

After it has been created, open it in nvi.

Type ':' or '/', then backspace. (I.e., put a character in the status bar.)

Type 'A' to append to the line, and insert a single space.

At this point, '^@' will show up to the right of the cursor.

esc :q!

On both my i386 and amd64 machines, this will crash about 1 in 20 times. Where it crashes varies; I've seen it crash immediately after 'A', immediately after 'esc', or immediately after ':q!enter'.

@bentley
Copy link
Collaborator Author

bentley commented Oct 24, 2013

#0  seq_find (sp=0x17904beaec10, lastqp=0x0, e_input=0x179047703000,
    c_input=0x0, ilen=1, stype=SEQ_INPUT, ispartialp=0x7f7ffffddd7c)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/common/seq.c:236
#1  0x0000178e45f14587 in v_event_get (sp=0x17904fc3b630, argp=0x7f7ffffde1a0,
    timeout=0, flags=4)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/common/key.c:646
#2  0x0000178e45f42c84 in v_txt (sp=0x17904fc3b630, vp=0x7f7ffffde3f0, tm=Variable "tm" is not available.
)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/vi/v_txt.c:480
#3  0x0000178e45f3c3fc in v_ia (sp=0x17904fc3b630, vp=0x7f7ffffde3f0)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/vi/v_itxt.c:114
#4  0x0000178e45f3c54f in v_iA (sp=0x17904fc3b630, vp=0x7f7ffffde3f0)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/vi/v_itxt.c:77
#5  0x0000178e45f48531 in vi (spp=0x7f7ffffde608)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/vi/vi.c:229
#6  0x0000178e45f1778a in editor (gp=0x17904b81f000, argc=2,
    argv=0x7f7ffffde7f8)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/common/main.c:421
#7  0x0000178e45f0d4d1 in main (argc=2, argv=0x7f7ffffde7f0)
    at /usr/ports/pobj/nvi-2.1.1-iconv/nvi-2.1.1/cl/cl_main.c:120

lichray added a commit that referenced this issue Oct 24, 2013
The meaning of buffer length was changed from characters count to
bytes count.  This is the only place I found so far which wildly
compares the text length to buffer length.

Closes-Issue: #8
@lichray
Copy link
Owner

lichray commented Oct 24, 2013

Fixed after reproducing in FreeBSD. Thank you very much! I reworked the memory allocation macros some time ago, and it seems that the original nvi code does not always use the macros to manage memory.

Can you confirm the fix on OpenBSD as well? Thanks.

@bentley
Copy link
Collaborator Author

bentley commented Oct 26, 2013

Can no longer reproduce the problem. Thanks!

@bentley bentley closed this as completed Oct 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants