> I'm one of the maintainers for govim, a Go plugin for vim. As part of our 
> CI we run against latest vim daily and recently it started to fail. I 
> bisected the change to v8.2.4699, with the commit message "hard to 
> reproduce hang when reading from channel" but it seems like it introduced a 
> new (100% reproducible) hang for us.
> 
> I picked one of our tests that failed, where we use "feedkeys()" to trigger 
> autocompletion.
> >From earlier discussions on this list I know that we should avoid using 
> "feedkeys()" in favour of "normal", but I've seen this hang triggered when 
> using normal as well.
> 
> What happens is that vim spins at 100% CPU until the test times out.
> 
> This is the steps executed by that test, they probably doesn't make sense 
> as is but I hope that the diff below can provide some hints:
>  vim ex 'e main.go'
>  vim ex 'call cursor(11,1)'
>  vim ex 'call feedkeys(\"A\\<C-X>\\<C-O>\\<C-N>\\<C-N>\\<ESC>\", \"xt\")'
>  vim ex 'call feedkeys(\"A(Con\", \"xt\")'
>  vim ex 'call feedkeys(\"A\\<C-X>\\<C-O>\\<C-N>\\<ESC>\", \"xt\")'
>  vim ex 'call feedkeys(\"A)\", \"xt\")'
>  vim ex 'w'
> 
> Changing so that we send <ESC> on the second feedkeys, and add mode "!" to 
> the last will make the test pass:
> 
>  vim ex 'e main.go'
>  vim ex 'call cursor(11,1)'
>  vim ex 'call feedkeys(\"A\\<C-X>\\<C-O>\\<C-N>\\<C-N>\\<ESC>\", \"xt\")'
>  vim ex 'call feedkeys(\"A(Con\\<C-X>\\<C-O>\\<C-N>\\<ESC>\", \"xt\")'
>  vim ex 'call feedkeys(\"A)\\<ESC>\", \"xt!\")'
>  vim ex 'w'
> 
> I haven't created a smaller reproducible yet but I did capture a stack 
> trace when it 
> happens, https://gist.github.com/leitzler/a75f2312f551332ec0c687397e77dda5.
> 
> Any guidance on how to proceed with the debugging here?

The problem with using feedkeys() is that it does not go through the
normal execution loop.  It often works, but not for everything.
Especially message handling, which happens when waiting for the user to
type something, can be a problem.

Have you tried doing these tests by running Vim in a terminal window?
That is more realistic, using term_sendkeys() to have it execute
commands.

-- 
Bumper sticker: Honk if you love peace and quiet.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220423125107.01E4F1C43E2%40moolenaar.net.

Raspunde prin e-mail lui