Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vim8 hang when ch_status() == 'buffered' but ch_read returns nothing #121

Merged
merged 1 commit into from
Jul 31, 2017

Conversation

dmotles
Copy link
Contributor

@dmotles dmotles commented Jul 13, 2017

It seems that sometimes, the ch_status is buffered, but ch_read is
returning nothing. vim_oneshot_handler is stuck in an infinite loop.

Since this is happening in the main thread, vim appears to lockup until
you hit Ctrl+c or something to interrupt eval of this code.

Specifically, I've seen this when using the clang autocompletion on
C-like languages. If I was typing particularly fast, I would see this
issue occur. It was getting annoying.

I ran vim in GDB to try and figure out what was going
on, saw that it was evaling this code inside this function. I then added
logging to this function and confirmed that the problem was here.

Based on my understanding, it is safe to exit the loop early, you might
just not get all your completions...

It seems that sometimes, the ch_status is buffered, but ch_read is
returning nothing. It causes the vim_oneshot_handler to get stuck in an
infinite loop.

Since this is happening in the main thread, vim appears to lockup until
you hit <C-c> or something to interrupt eval of this code.

Specifically, I've seen this when using the clang autocompletion on
C-like languages. If I was typing particularly fast, I would see this
issue occur. It was getting annoying.

I ran vim in GDB to try and figure out what was going
on, saw that it was evaling this code inside this function. I then added
logging to this function and confirmed that lockups in vim corresponded
to being stuck in an infinite loop inside this function.

Based on my understanding, it is safe to exit the loop early, you might
just not get all your completions...
@dmotles
Copy link
Contributor Author

dmotles commented Jul 13, 2017

This might fix #115

@maralla
Copy link
Owner

maralla commented Jul 31, 2017

Thanks!

@maralla maralla merged commit 4d015eb into maralla:master Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants