Loading ...
Sorry, an error occurred while loading the content.

recovery wrongly deletes almost 300 lines from large files

Expand Messages
  • Bo Milvang-Jensen
    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
    Message 1 of 3 , Aug 10, 2011
    • 0 Attachment
      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

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Bram Moolenaar
      ... Most likely this is solved by patch 7.3.216 -- Dreams are free, but there s a small charge for alterations. /// Bram Moolenaar -- Bram@Moolenaar.net --
      Message 2 of 3 , Aug 10, 2011
      • 0 Attachment
        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

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

        /// Bram Moolenaar -- Bram@... -- 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 ///

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Bo Milvang-Jensen
        ... 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
        Message 3 of 3 , Sep 3, 2012
        • 0 Attachment
          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

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.