To: vim_dev@googlegroups.com Subject: Patch 8.2.2424 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2424 Problem: Some tests are known to cause an error with ASAN. Solution: Add CheckNotAsan. Files: src/testdir/check.vim, src/testdir/test_ins_complete.vim, src/testdir/test_memory_usage.vim, src/testdir/test_ex_mode.vim *** ../vim-8.2.2423/src/testdir/check.vim 2020-04-30 19:09:31.750196251 +0200 --- src/testdir/check.vim 2021-01-28 18:28:28.188636372 +0100 *************** *** 183,186 **** --- 183,194 ---- return v:false endfunc + " Command to check for not running under ASAN + command CheckNotAsan call CheckNotAsan() + func CheckNotAsan() + if execute('version') =~# '-fsanitize=[a-z,]*\' + throw 'Skipped: does not work with ASAN' + endif + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2423/src/testdir/test_ins_complete.vim 2021-01-26 22:42:17.694836803 +0100 --- src/testdir/test_ins_complete.vim 2021-01-28 18:30:46.476272331 +0100 *************** *** 562,588 **** call setline(1, ['', 'abcd', '']) call assert_fails('exe "normal 2G$a\\"', 'E578:') - " Jump to a different window from the complete function - " TODO: The following test causes an ASAN failure. Once this issue is - " addressed, enable the following test. - "func! CompleteFunc(findstart, base) - " if a:findstart == 1 - " return col('.') - 1 - " endif - " wincmd p - " return ['a', 'b'] - "endfunc - "set completefunc=CompleteFunc - "new - "call assert_fails('exe "normal a\\"', 'E839:') - "close! - set completefunc& delfunc CompleteFunc delfunc CompleteFunc2 close! endfunc " Test for returning non-string values from 'completefunc' func Test_completefunc_invalid_data() new --- 562,594 ---- call setline(1, ['', 'abcd', '']) call assert_fails('exe "normal 2G$a\\"', 'E578:') set completefunc& delfunc CompleteFunc delfunc CompleteFunc2 close! endfunc + func Test_completefunc_error_not_asan() + " The following test causes an ASAN failure. + CheckNotAsan + + " Jump to a different window from the complete function + func! CompleteFunc(findstart, base) + if a:findstart == 1 + return col('.') - 1 + endif + wincmd p + return ['a', 'b'] + endfunc + set completefunc=CompleteFunc + new + call assert_fails('exe "normal a\\"', 'E839:') + close! + + set completefunc& + delfunc CompleteFunc + endfunc + " Test for returning non-string values from 'completefunc' func Test_completefunc_invalid_data() new *** ../vim-8.2.2423/src/testdir/test_memory_usage.vim 2020-08-12 18:50:31.883655785 +0200 --- src/testdir/test_memory_usage.vim 2021-01-28 18:28:12.536675277 +0100 *************** *** 4,14 **** CheckFeature terminal CheckNotGui ! if execute('version') =~# '-fsanitize=[a-z,]*\' ! " Skip tests on Travis CI ASAN build because it's difficult to estimate ! " memory usage. ! throw 'Skipped: does not work with ASAN' ! endif source shared.vim --- 4,12 ---- CheckFeature terminal CheckNotGui ! " Skip tests on Travis CI ASAN build because it's difficult to estimate memory ! " usage. ! CheckNotAsan source shared.vim *** ../vim-8.2.2423/src/testdir/test_ex_mode.vim 2021-01-28 17:24:54.277803692 +0100 --- src/testdir/test_ex_mode.vim 2021-01-28 18:32:41.679945910 +0100 *************** *** 207,212 **** --- 207,215 ---- endfunc func Test_ex_mode_count_overflow() + " The multiplication causes an integer overflow + CheckNotAsan + " this used to cause a crash let lines =<< trim END call feedkeys("\Q\") *** ../vim-8.2.2423/src/version.c 2021-01-28 17:56:06.718493438 +0100 --- src/version.c 2021-01-28 18:32:56.587902366 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2424, /**/ -- hundred-and-one symptoms of being an internet addict: 261. You find diskettes in your pockets when doing laundry. /// Bram Moolenaar -- Bram@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 ///