On Tue, Jun 17, 2014 at 11:30 PM, Dominique Pellé
<[email protected]> wrote:
> Hi
>
> Valgrind reports errors when running test63 with vim-7.4.333:
>
> ==15791== Memcheck, a memory error detector
> ==15791== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
> ==15791== Using Valgrind-3.9.0.SVN and LibVEX; rerun with -h for copyright 
> info
> ==15791== Command: ../vim -u unix.vim -U NONE --noplugin -s dotest.in 
> test63.in
> ==15791== Parent PID: 15790
> ==15791==
> ==15791== Conditional jump or move depends on uninitialised value(s)
> ==15791==    at 0x56C366: next_search_hl (screen.c:7464)
> ==15791==    by 0x56431D: win_line (screen.c:3448)
> ==15791==    by 0x560E66: win_update (screen.c:2000)
> ==15791==    by 0x55E4F4: update_screen (screen.c:677)
> ==15791==    by 0x5FB03D: main_loop (main.c:1229)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==  Uninitialised value was created by a stack allocation
> ==15791==    at 0x56C0B0: next_search_hl (screen.c:7367)
> ==15791==
> ==15791== Conditional jump or move depends on uninitialised value(s)
> ==15791==    at 0x56C424: next_search_hl_pos (screen.c:7493)
> ==15791==    by 0x56C35A: next_search_hl (screen.c:7462)
> ==15791==    by 0x56431D: win_line (screen.c:3448)
> ==15791==    by 0x560E66: win_update (screen.c:2000)
> ==15791==    by 0x55E4F4: update_screen (screen.c:677)
> ==15791==    by 0x5FB03D: main_loop (main.c:1229)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==  Uninitialised value was created by a heap allocation
> ==15791==    at 0x4C2A45D: malloc (vg_replace_malloc.c:291)
> ==15791==    by 0x4E8367: lalloc (misc2.c:921)
> ==15791==    by 0x4E8275: alloc (misc2.c:820)
> ==15791==    by 0x5DAB31: match_add (window.c:6812)
> ==15791==    by 0x482962: ex_match (ex_docmd.c:11492)
> ==15791==    by 0x47394B: do_one_cmd (ex_docmd.c:2701)
> ==15791==    by 0x470E70: do_cmdline (ex_docmd.c:1126)
> ==15791==    by 0x50267C: nv_colon (normal.c:5308)
> ==15791==    by 0x4FB183: normal_cmd (normal.c:1156)
> ==15791==    by 0x5FB29C: main_loop (main.c:1326)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==
> ==15791== Conditional jump or move depends on uninitialised value(s)
> ==15791==    at 0x5DB0A7: match_delete (window.c:6981)
> ==15791==    by 0x482764: ex_match (ex_docmd.c:11457)
> ==15791==    by 0x47394B: do_one_cmd (ex_docmd.c:2701)
> ==15791==    by 0x470E70: do_cmdline (ex_docmd.c:1126)
> ==15791==    by 0x50267C: nv_colon (normal.c:5308)
> ==15791==    by 0x4FB183: normal_cmd (normal.c:1156)
> ==15791==    by 0x5FB29C: main_loop (main.c:1326)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==  Uninitialised value was created by a heap allocation
> ==15791==    at 0x4C2A45D: malloc (vg_replace_malloc.c:291)
> ==15791==    by 0x4E8367: lalloc (misc2.c:921)
> ==15791==    by 0x4E8275: alloc (misc2.c:820)
> ==15791==    by 0x5DAB31: match_add (window.c:6812)
> ==15791==    by 0x482962: ex_match (ex_docmd.c:11492)
> ==15791==    by 0x47394B: do_one_cmd (ex_docmd.c:2701)
> ==15791==    by 0x470E70: do_cmdline (ex_docmd.c:1126)
> ==15791==    by 0x50267C: nv_colon (normal.c:5308)
> ==15791==    by 0x4FB183: normal_cmd (normal.c:1156)
> ==15791==    by 0x5FB29C: main_loop (main.c:1326)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==
> ==15791== Conditional jump or move depends on uninitialised value(s)
> ==15791==    at 0x5DB0A7: match_delete (window.c:6981)
> ==15791==    by 0x4485A5: f_matchdelete (eval.c:14443)
> ==15791==    by 0x43FA2D: call_func (eval.c:8596)
> ==15791==    by 0x43F465: get_func_tv (eval.c:8403)
> ==15791==    by 0x437DA1: ex_call (eval.c:3487)
> ==15791==    by 0x47394B: do_one_cmd (ex_docmd.c:2701)
> ==15791==    by 0x470E70: do_cmdline (ex_docmd.c:1126)
> ==15791==    by 0x50267C: nv_colon (normal.c:5308)
> ==15791==    by 0x4FB183: normal_cmd (normal.c:1156)
> ==15791==    by 0x5FB29C: main_loop (main.c:1326)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==  Uninitialised value was created by a heap allocation
> ==15791==    at 0x4C2A45D: malloc (vg_replace_malloc.c:291)
> ==15791==    by 0x4E8367: lalloc (misc2.c:921)
> ==15791==    by 0x4E8275: alloc (misc2.c:820)
> ==15791==    by 0x5DAB31: match_add (window.c:6812)
> ==15791==    by 0x4482FB: f_matchadd (eval.c:14347)
> ==15791==    by 0x43FA2D: call_func (eval.c:8596)
> ==15791==    by 0x43F465: get_func_tv (eval.c:8403)
> ==15791==    by 0x43AC2D: eval7 (eval.c:5181)
> ==15791==    by 0x43A4DD: eval6 (eval.c:4832)
> ==15791==    by 0x43A011: eval5 (eval.c:4648)
> ==15791==    by 0x439325: eval4 (eval.c:4341)
> ==15791==    by 0x439168: eval3 (eval.c:4253)
> ==15791==    by 0x438FE7: eval2 (eval.c:4182)
> ==15791==    by 0x438E26: eval1 (eval.c:4107)
> ==15791==    by 0x438D85: eval0 (eval.c:4064)
> ==15791==
> ==15791== Conditional jump or move depends on uninitialised value(s)
> ==15791==    at 0x5DAC8E: match_add (window.c:6854)
> ==15791==    by 0x44846C: f_matchaddpos (eval.c:14398)
> ==15791==    by 0x43FA2D: call_func (eval.c:8596)
> ==15791==    by 0x43F465: get_func_tv (eval.c:8403)
> ==15791==    by 0x437DA1: ex_call (eval.c:3487)
> ==15791==    by 0x47394B: do_one_cmd (ex_docmd.c:2701)
> ==15791==    by 0x470E70: do_cmdline (ex_docmd.c:1126)
> ==15791==    by 0x50267C: nv_colon (normal.c:5308)
> ==15791==    by 0x4FB183: normal_cmd (normal.c:1156)
> ==15791==    by 0x5FB29C: main_loop (main.c:1326)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==  Uninitialised value was created by a stack allocation
> ==15791==    at 0x5DA92B: match_add (window.c:6761)
> ==15791==
> ==15791== Conditional jump or move depends on uninitialised value(s)
> ==15791==    at 0x5DACF3: match_add (window.c:6866)
> ==15791==    by 0x44846C: f_matchaddpos (eval.c:14398)
> ==15791==    by 0x43FA2D: call_func (eval.c:8596)
> ==15791==    by 0x43F465: get_func_tv (eval.c:8403)
> ==15791==    by 0x437DA1: ex_call (eval.c:3487)
> ==15791==    by 0x47394B: do_one_cmd (ex_docmd.c:2701)
> ==15791==    by 0x470E70: do_cmdline (ex_docmd.c:1126)
> ==15791==    by 0x50267C: nv_colon (normal.c:5308)
> ==15791==    by 0x4FB183: normal_cmd (normal.c:1156)
> ==15791==    by 0x5FB29C: main_loop (main.c:1326)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==  Uninitialised value was created by a stack allocation
> ==15791==    at 0x5DA92B: match_add (window.c:6761)
> ==15791==
> ==15791== Conditional jump or move depends on uninitialised value(s)
> ==15791==    at 0x5DAD2C: match_add (window.c:6872)
> ==15791==    by 0x44846C: f_matchaddpos (eval.c:14398)
> ==15791==    by 0x43FA2D: call_func (eval.c:8596)
> ==15791==    by 0x43F465: get_func_tv (eval.c:8403)
> ==15791==    by 0x437DA1: ex_call (eval.c:3487)
> ==15791==    by 0x47394B: do_one_cmd (ex_docmd.c:2701)
> ==15791==    by 0x470E70: do_cmdline (ex_docmd.c:1126)
> ==15791==    by 0x50267C: nv_colon (normal.c:5308)
> ==15791==    by 0x4FB183: normal_cmd (normal.c:1156)
> ==15791==    by 0x5FB29C: main_loop (main.c:1326)
> ==15791==    by 0x5FABA8: main (main.c:1026)
> ==15791==  Uninitialised value was created by a stack allocation
> ==15791==    at 0x5DA92B: match_add (window.c:6761)
> ==15791==
>
> Compiling with gcc -O2, I also get this compilation warning
> which also points to the same bug:
>
> screen.c:7471:3: warning: 'nmatched' may be used uninitialized in this
> function [-Wmaybe-uninitialized]
>
> Bug is introduced in vim-7.4.330.
>
> Attached patch fixes it but but I don't understand this
> code enough to tell whether it's correct, so please
> review it. Patch also fixes a typo in :help matchaddpos().
>
> Regards
> Dominique


I just see that my patch fixes another bug with Vim-7.4.333:

Type:

$ vim vim/src/screen.c +312

Then move cursor up and down with k j around
the curly brace at line screen.c:312.

Observe that the curly brace sometimes remains
highlighted when moving above or below the curly brace.
That's a bug. Curly brace should not be highlighted when
moving above or below it. The proposed patch that fixes
valgrind errors also happens to fix this bug with spurious
highlight of parenthesis.

Dominique

-- 
-- 
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.

Raspunde prin e-mail lui