pkgsrc-Bugs archive

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

pkg/42909: vim misbehaves when deleting or changing a text block that includes "end-of-line" ($)

>Number:         42909
>Category:       pkg
>Synopsis:       vim misbehaves when deleting or changing a text block that 
>includes "end-of-line" ($)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 02 04:05:00 +0000 2010
>Originator:     Anne Bennett
>Release:        5.0.1
NetBSD 5.0.1 NetBSD 5.0.1 (QUILL_I386-$Revision: 
2010-01-05 $) #4: Thu Jan 21 13:56:23 EST 2010
Mostly the same as pkg/39375; sorry, I don't know how to just update
that one.  Merge this in if you can...

In short, "vim" has problems with deleting or replacing text blocks
(as marked with ctrl-v); sometimes it says:

  E342: Out of memory!  (allocating 4294967291 bytes)
  cannot yank; delete anyway (y/n)?

If I say "y" (or if it did not complain), it does "something else",
for example, inserting several columns of spaces instead of deleting
the marked block.  While experimenting just now, I found it happened
every time if I marked a block from a column to "the end of the
line", whereas it behaved normally for a block that did not include
"$", which I think is significant.

It seems to take at least two lines to trigger the problem; see the
next section for a tiny example.

This is vim 7.2.320 from pkgsrc 2009Q4, on NetBSD 5.0.1.  It worked
fine on my previous O/S (NetBSD 3.1), though that would have been
an earlier vim as well.  At work I have 6.3.81 and 7.2.60 on Linux,
and there are no problems.  In fact, I've been using vim for close
to two decades on several Unixes, including NetBSD for the past 15
years or so, and I've never seen anything like this.


Here's the tiniest example I've come up with:
Create a file containing:


then using control-v, mark a block starting in the first column
and including the end of the line AS OBTAINED WITH "$".  Then hit
"x" to delete the block.  In this case, only the first column will
be deleted!

With longer lines, say:


mark from the third column to the end ("$") and try to delete ("x").

  E341: Internal error: lalloc(0, )
  cannot yank; delete anyway (y/n)?

If I answer "y", it deletes column 2 and adds a space before column 3.

Try something with more and longer lines (mark a bigger block, again
that ends with "$"), and you'll eventually get:

  E342: Out of memory!  (allocating 4294967295 bytes)
  cannot yank; delete anyway (y/n)?

When I marked from the third column to the end, it deleted column 3
and added two columns of spaces before column 4.

It smacks of some kind of wraparound or off-by-one error...


No idea.  :-(

Home | Main Index | Thread Index | Old Index