Comment #7 on issue 369 by [email protected]: Crypt method blowfish
corrupts large files in 7.4. Okay in 7.3.
https://code.google.com/p/vim/issues/detail?id=369
Using valgrind, I can see problems using Vim-7.4.729 on Linux x86_64.
When doing:
$ valgrind --log-file=vg.log --leak-check=yes --track-fds=yes
--num-callers=50 --track-origins=yes vim num.txt
:set cm=blowfish
:set key=num
After this, I can already see bugs with valgrind:
===
==7298== Memcheck, a memory error detector
==7298== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==7298== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright
info
==7298== Command: ./vim num.txt
==7298== Parent PID: 2437
==7298==
==7298== Use of uninitialised value of size 8
==7298== at 0x410614: bf_e_block (blowfish.c:360)
==7298== by 0x410E46: bf_e_cblock (blowfish.c:396)
==7298== by 0x41157E: crypt_blowfish_encode (blowfish.c:618)
==7298== by 0x415291: crypt_encode (crypt.c:448)
==7298== by 0x4C2A24: ml_encrypt_data (memline.c:4874)
==7298== by 0x5E0D57: mf_write_block (memfile.c:1139)
==7298== by 0x5E0C56: mf_write (memfile.c:1095)
==7298== by 0x5E06FD: mf_release (memfile.c:870)
==7298== by 0x5DFFD8: mf_get (memfile.c:453)
==7298== by 0x4BB1AB: ml_upd_block0 (memline.c:940)
==7298== by 0x4BA837: ml_set_crypt_key (memline.c:515)
==7298== by 0x512B91: did_set_string_option (option.c:6166)
==7298== by 0x510853: do_set (option.c:4894)
==7298== by 0x47C23A: ex_set (ex_docmd.c:11996)
==7298== by 0x46D148: do_one_cmd (ex_docmd.c:2940)
==7298== by 0x469EC8: do_cmdline (ex_docmd.c:1133)
==7298== by 0x4F89F7: nv_colon (normal.c:5393)
==7298== by 0x4F1DD8: normal_cmd (normal.c:1160)
==7298== by 0x5D7A65: main_loop (main.c:1347)
==7298== by 0x5D738A: main (main.c:1047)
==7298== Uninitialised value was created by a heap allocation
==7298== at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7298== by 0x4E0F46: lalloc (misc2.c:926)
==7298== by 0x4E0E1E: alloc (misc2.c:821)
==7298== by 0x5DF70A: mf_open (memfile.c:135)
==7298== by 0x4BA2D6: ml_open (memline.c:316)
==7298== by 0x4057AE: open_buffer (buffer.c:98)
==7298== by 0x5D96C7: create_windows (main.c:2692)
==7298== by 0x5D703D: main (main.c:881)
==7298==
.... skip many other access to uninitialized memory ....
==7298== Syscall param write(buf) points to uninitialised byte(s)
==7298== at 0x6646870: __write_nocancel (syscall-template.S:81)
==7298== by 0x49AA51: write_eintr (fileio.c:10393)
==7298== by 0x5E0D81: mf_write_block (memfile.c:1145)
==7298== by 0x5E0C56: mf_write (memfile.c:1095)
==7298== by 0x5E06FD: mf_release (memfile.c:870)
==7298== by 0x5DFFD8: mf_get (memfile.c:453)
==7298== by 0x4BB1AB: ml_upd_block0 (memline.c:940)
==7298== by 0x4BA837: ml_set_crypt_key (memline.c:515)
==7298== by 0x512B91: did_set_string_option (option.c:6166)
==7298== by 0x510853: do_set (option.c:4894)
==7298== by 0x47C23A: ex_set (ex_docmd.c:11996)
==7298== by 0x46D148: do_one_cmd (ex_docmd.c:2940)
==7298== by 0x469EC8: do_cmdline (ex_docmd.c:1133)
==7298== by 0x4F89F7: nv_colon (normal.c:5393)
==7298== by 0x4F1DD8: normal_cmd (normal.c:1160)
==7298== by 0x5D7A65: main_loop (main.c:1347)
==7298== by 0x5D738A: main (main.c:1047)
==7298== Address 0x8afb575 is 373 bytes inside a block of size 4,096
alloc'd
==7298== at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7298== by 0x4E0F46: lalloc (misc2.c:926)
==7298== by 0x4E0E1E: alloc (misc2.c:821)
==7298== by 0x4C2960: ml_encrypt_data (memline.c:4862)
==7298== by 0x5E0D57: mf_write_block (memfile.c:1139)
==7298== by 0x5E0C56: mf_write (memfile.c:1095)
==7298== by 0x5E06FD: mf_release (memfile.c:870)
==7298== by 0x5DFFD8: mf_get (memfile.c:453)
==7298== by 0x4BB1AB: ml_upd_block0 (memline.c:940)
==7298== by 0x4BA837: ml_set_crypt_key (memline.c:515)
==7298== by 0x512B91: did_set_string_option (option.c:6166)
==7298== by 0x510853: do_set (option.c:4894)
==7298== by 0x47C23A: ex_set (ex_docmd.c:11996)
==7298== by 0x46D148: do_one_cmd (ex_docmd.c:2940)
==7298== by 0x469EC8: do_cmdline (ex_docmd.c:1133)
==7298== by 0x4F89F7: nv_colon (normal.c:5393)
==7298== by 0x4F1DD8: normal_cmd (normal.c:1160)
==7298== by 0x5D7A65: main_loop (main.c:1347)
==7298== by 0x5D738A: main (main.c:1047)
==7298== Uninitialised value was created by a heap allocation
==7298== at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7298== by 0x4E0F46: lalloc (misc2.c:926)
==7298== by 0x4E0E1E: alloc (misc2.c:821)
==7298== by 0x5DF70A: mf_open (memfile.c:135)
==7298== by 0x4BA2D6: ml_open (memline.c:316)
==7298== by 0x4057AE: open_buffer (buffer.c:98)
==7298== by 0x5D96C7: create_windows (main.c:2692)
==7298== by 0x5D703D: main (main.c:881)
==7298==
Then when doing :w num2.txt I see this additional error:
==7298== Invalid read of size 1
==7298== at 0x492722: buf_write (fileio.c:4524)
==7298== by 0x4593AC: do_write (ex_cmds.c:2766)
==7298== by 0x458E9B: ex_write (ex_cmds.c:2575)
==7298== by 0x46D148: do_one_cmd (ex_docmd.c:2940)
==7298== by 0x469EC8: do_cmdline (ex_docmd.c:1133)
==7298== by 0x4F89F7: nv_colon (normal.c:5393)
==7298== by 0x4F1DD8: normal_cmd (normal.c:1160)
==7298== by 0x5D7A65: main_loop (main.c:1347)
==7298== by 0x5D738A: main (main.c:1047)
==7298== Address 0x9e724e0 is 0 bytes after a block of size 4,096 alloc'd
==7298== at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7298== by 0x4E0F46: lalloc (misc2.c:926)
==7298== by 0x4E0E1E: alloc (misc2.c:821)
==7298== by 0x5E090A: mf_alloc_bhdr (memfile.c:952)
==7298== by 0x5DFE44: mf_new (memfile.c:392)
==7298== by 0x4C0817: ml_new_data (memline.c:3545)
==7298== by 0x4BEE36: ml_append_int (memline.c:2793)
==7298== by 0x4BE78B: ml_append (memline.c:2567)
==7298== by 0x48EE9B: readfile (fileio.c:2252)
==7298== by 0x405930: open_buffer (buffer.c:147)
==7298== by 0x5D96C7: create_windows (main.c:2692)
==7298== by 0x5D703D: main (main.c:881)
==7298==
I don't see any error with valgrind when adding the -u NONE option:
$ vim -u NONE num.txt
:set cm=blowfish
:set key=num
:w num2.txt
:q!
-> No error found with valgrind.
So something in my ~/.vimrc is triggering a bug.
I have not had the time to investigate further yet, but I will try later.
I will at least narrow down what triggers the valgrind error in my ~/.vimrc.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
You received this message from the "vim_dev" 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
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.