Patch 8.2.0542

15 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 11, 2020, 12:37:15 PM4/11/20
to vim...@googlegroups.com

Patch 8.2.0542
Problem: No test for E386.
Solution: Add a test. (Dominique Pelle, closes #5911)
Files: src/testdir/test_search.vim


*** ../vim-8.2.0541/src/testdir/test_search.vim 2020-04-11 17:09:28.324426586 +0200
--- src/testdir/test_search.vim 2020-04-11 18:36:18.559194858 +0200
***************
*** 17,25 ****
set noincsearch
:1
call feedkeys("/foobar\<cr>", 'tx')
! call feedkeys("/the\<cr>",'tx')
call assert_equal('the', @/)
! call feedkeys("/thes\<C-P>\<C-P>\<cr>",'tx')
call assert_equal('foobar', @/)

" Test 2
--- 17,25 ----
set noincsearch
:1
call feedkeys("/foobar\<cr>", 'tx')
! call feedkeys("/the\<cr>", 'tx')
call assert_equal('the', @/)
! call feedkeys("/thes\<C-P>\<C-P>\<cr>", 'tx')
call assert_equal('foobar', @/)

" Test 2
***************
*** 1351,1357 ****
endfunc

func Test_one_error_msg()
! " This was also giving an internal error
call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:')
endfunc

--- 1351,1357 ----
endfunc

func Test_one_error_msg()
! " This was also giving an internal error
call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:')
endfunc

***************
*** 1402,1407 ****
--- 1402,1412 ----
call assert_fails("call search('pat', 'b', 1, [])", 'E745:')
call assert_fails("call search('pat', 'ns')", 'E475:')
call assert_fails("call search('pat', 'mr')", 'E475:')
+
+ new
+ call setline(1, ['foo', 'bar'])
+ call assert_fails('call feedkeys("/foo/;/bar/;\<CR>", "tx")', 'E386:')
+ bwipe!
endfunc

func Test_search_display_pattern()
*** ../vim-8.2.0541/src/version.c 2020-04-11 18:01:10.933802350 +0200
--- src/version.c 2020-04-11 18:35:17.151359481 +0200
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 542,
/**/

--
ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
BROTHER MAYNARD
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

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

Dominique Pellé

unread,
Apr 11, 2020, 1:15:33 PM4/11/20
to vim_dev
Bram Moolenaar wrote:

> Patch 8.2.0542
> Problem: No test for E386.
> Solution: Add a test. (Dominique Pelle, closes #5911)
> Files: src/testdir/test_search.vim

The asan build fails in Travis CI but I cannot download
the logs from Travis.

I'm not sure whether the CI failure is related to this patch.
Everything passes on my machine with an asan build.

Regards
Dominique

Dominique Pellé

unread,
Apr 11, 2020, 1:22:37 PM4/11/20
to vim_dev
I can reproduce an issue after all, a memory leak
found by asan when running "make test_search":

==3306==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 6 byte(s) in 1 object(s) allocated from:
#0 0x4975fd in malloc (/home/pel/sb/vim/src/vim+0x4975fd)
#1 0x8a129d in lalloc /home/pel/sb/vim/src/misc2.c:925:11
#2 0x8a11e9 in alloc /home/pel/sb/vim/src/misc2.c:828:12
#3 0xaea9fc in do_search /home/pel/sb/vim/src/search.c:1419:15
#4 0x922f99 in normal_search /home/pel/sb/vim/src/normal.c:4312:9
#5 0x906b77 in nv_search /home/pel/sb/vim/src/normal.c:4263:11
#6 0x8edc71 in normal_cmd /home/pel/sb/vim/src/normal.c:1071:5
#7 0x6f855b in exec_normal /home/pel/sb/vim/src/ex_docmd.c:7797:6
#8 0x6522c2 in f_feedkeys /home/pel/sb/vim/src/evalfunc.c:2583:3
#9 0x645131 in call_internal_func /home/pel/sb/vim/src/evalfunc.c:1170:5
#10 0xca4cfa in call_func /home/pel/sb/vim/src/userfunc.c:1898:14
#11 0xca386f in get_func_tv /home/pel/sb/vim/src/userfunc.c:564:8
#12 0xcbe050 in ex_call /home/pel/sb/vim/src/userfunc.c:3582:6
#13 0x6dbae2 in do_one_cmd /home/pel/sb/vim/src/ex_docmd.c:2509:2
#14 0x6cd6e6 in do_cmdline /home/pel/sb/vim/src/ex_docmd.c:978:17
#15 0x6d13a3 in do_cmdline_cmd /home/pel/sb/vim/src/ex_docmd.c:589:12
#16 0xc62149 in f_assert_fails /home/pel/sb/vim/src/testing.c:436:5
#17 0x645131 in call_internal_func /home/pel/sb/vim/src/evalfunc.c:1170:5
#18 0xca4cfa in call_func /home/pel/sb/vim/src/userfunc.c:1898:14
#19 0xca386f in get_func_tv /home/pel/sb/vim/src/userfunc.c:564:8
#20 0xcbe050 in ex_call /home/pel/sb/vim/src/userfunc.c:3582:6
#21 0x6dbae2 in do_one_cmd /home/pel/sb/vim/src/ex_docmd.c:2509:2
#22 0x6cd6e6 in do_cmdline /home/pel/sb/vim/src/ex_docmd.c:978:17
#23 0xca90a6 in call_user_func /home/pel/sb/vim/src/userfunc.c:1332:2
#24 0xca6122 in call_user_func_check /home/pel/sb/vim/src/userfunc.c:1473:2
#25 0xca4b69 in call_func /home/pel/sb/vim/src/userfunc.c:1880:11
#26 0xca386f in get_func_tv /home/pel/sb/vim/src/userfunc.c:564:8
#27 0xcbe050 in ex_call /home/pel/sb/vim/src/userfunc.c:3582:6
#28 0x6dbae2 in do_one_cmd /home/pel/sb/vim/src/ex_docmd.c:2509:2
#29 0x6cd6e6 in do_cmdline /home/pel/sb/vim/src/ex_docmd.c:978:17

Dominique Pellé

unread,
Apr 11, 2020, 2:47:51 PM4/11/20
to vim_dev
I've created a PR to fix the memory leak. See:
https://github.com/vim/vim/pull/5912

Regards
Dominique
Reply all
Reply to author
Forward
0 new messages