recovery wrongly deletes almost 300 lines from large files

20 views
Skip to first unread message

Bo Milvang-Jensen

unread,
Aug 10, 2011, 11:16:21 AM8/10/11
to v...@vim.org
Dear vim mailing list,

I have found a bug in vim's recovery.
To reproduce: create a file "test" with 40000 lines, with each line
containing 78 minuses, a la

78a-<ESC>
yy
39999p
:wq

Copy that file to test_save

Edit test again, add one line, do not do :w, but rather kill vim
(kill <PID>).
Do "vim test" again, press r for recovery, do :wq

The result is that the recovered file test does contain the newly added
line (good), but it misses 292 of the original lines (bad!) I.e.

wc test_save test
40000 40000 3160000 test_save
39707 39709 3136791 test

The above test has been done with vim 7.3 compiled on a 32 bit LINUX machine
and with vim 6.3.82 (from Kubuntu 10.10) on a 64 bit LINUX machine.

Cheers, Bo Milvang-Jensen

Bram Moolenaar

unread,
Aug 10, 2011, 4:38:42 PM8/10/11
to Bo Milvang-Jensen, v...@vim.org

Bo Milvang-Jensen wrote:

Most likely this is solved by patch 7.3.216

--
Dreams are free, but there's a small charge for alterations.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Bo Milvang-Jensen

unread,
Sep 3, 2012, 10:50:14 AM9/3/12
to vim...@googlegroups.com
On Wed, Aug 10, 2011 at 10:38:42PM +0200, Bram Moolenaar wrote:
>
> Bo Milvang-Jensen wrote:
>
> > I have found a bug in vim's recovery.
> > To reproduce: create a file "test" with 40000 lines, with each line
> > containing 78 minuses, a la
> >
> > 78a-<ESC>
> > yy
> > 39999p
> > :wq
> >
> > Copy that file to test_save
> >
> > Edit test again, add one line, do not do :w, but rather kill vim
> > (kill <PID>).
> > Do "vim test" again, press r for recovery, do :wq
> >
> > The result is that the recovered file test does contain the newly added
> > line (good), but it misses 292 of the original lines (bad!) I.e.
> >
> > wc test_save test
> > 40000 40000 3160000 test_save
> > 39707 39709 3136791 test
> >
> > The above test has been done with vim 7.3 compiled on a 32 bit LINUX machine
> > and with vim 6.3.82 (from Kubuntu 10.10) on a 64 bit LINUX machine.
>
> Most likely this is solved by patch 7.3.216

Dear Bram,

I just wanted to say thank you for your reply, and here a year after(!)
I finally managed to get patch 7.3.216, using your aap programme,
and my tests suggest that vim now correctly recovers large files!

Thanks,
Cheers, Bo
Reply all
Reply to author
Forward
0 new messages