From e429e70f050cb2941f1f8427cf918b68444c904e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 10 Jun 2016 19:49:14 +0200 Subject: [PATCH 1/3] patch 7.4.1914 Problem: Executing autocommands while using the signal stack has a high chance of crashing Vim. Solution: Don't invoke autocommands when on the signal stack. --- src/os_unix.c | 8 ++++++++ src/version.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/os_unix.c b/src/os_unix.c index 4b2c99e85e..f08adc58b1 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1090,6 +1090,12 @@ deathtrap SIGDEFARG(sigarg) /* Remember how often we have been called. */ ++entered; +#ifdef FEAT_AUTOCMD + /* Executing autocommands is likely to use more stack space than we have + * available in the signal stack. */ + block_autocmds(); +#endif + #ifdef FEAT_EVAL /* Set the v:dying variable. */ set_vim_var_nr(VV_DYING, (long)entered); @@ -1171,6 +1177,8 @@ deathtrap SIGDEFARG(sigarg) * calling free(). */ preserve_exit(); + /* NOTREACHED */ + #ifdef NBDEBUG reset_signals(); may_core_dump(); diff --git a/src/version.c b/src/version.c index 563ac9f1ae..4a2d5378a7 100644 --- a/src/version.c +++ b/src/version.c @@ -753,6 +753,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1914, /**/ 1913, /**/ From 2a67ed83a885e8e65e25498660dae4f34d532c7b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 10 Jun 2016 21:52:42 +0200 Subject: [PATCH 2/3] patch 7.4.1915 Problem: The effect of the PopupMenu autocommand isn't directly visible. Solution: Call gui_update_menus() before displaying the popup menu. (Shane Harper, closs #855) --- src/menu.c | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/menu.c b/src/menu.c index b6f8ce47ab..2802de33d7 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1970,7 +1970,12 @@ gui_show_popupmenu(void) /* Only show a popup when it is defined and has entries */ if (menu != NULL && menu->children != NULL) + { + /* Update the menus now, in case the MenuPopup autocommand did + * anything. */ + gui_update_menus(0); gui_mch_show_popupmenu(menu); + } } #endif /* FEAT_GUI */ diff --git a/src/version.c b/src/version.c index 4a2d5378a7..1acd1e4cb6 100644 --- a/src/version.c +++ b/src/version.c @@ -753,6 +753,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1915, /**/ 1914, /**/ From b8aefa46adf5e825118716e142fab7ef32076475 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 10 Jun 2016 23:02:56 +0200 Subject: [PATCH 3/3] patch 7.4.1916 Problem: No proper test for what 7.4.1906 fixes. Solution: Add a test for reading many lines. --- src/testdir/test_channel.vim | 14 ++++++++++++++ src/version.c | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index d65e528b7b..9d68a14cce 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1335,6 +1335,20 @@ func Test_using_freed_memory() call test_garbagecollect_now() endfunc +func Test_collapse_buffers() + if !executable('cat') + return + endif + sp test_channel.vim + let g:linecount = line('$') + close + split testout + 1,$delete + call job_start('cat test_channel.vim', {'out_io': 'buffer', 'out_name': 'testout'}) + call s:waitFor('line("$") > g:linecount') + call assert_true(line('$') > g:linecount) + bwipe! +endfunc " Uncomment this to see what happens, output is in src/testdir/channellog. diff --git a/src/version.c b/src/version.c index 1acd1e4cb6..dfeee72569 100644 --- a/src/version.c +++ b/src/version.c @@ -753,6 +753,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1916, /**/ 1915, /**/